#57 AMOLED theme
This commit is contained in:
@@ -360,7 +360,7 @@
|
|||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||||
CURRENT_PROJECT_VERSION = 333;
|
CURRENT_PROJECT_VERSION = 341;
|
||||||
DEVELOPMENT_TEAM = BA88US33G6;
|
DEVELOPMENT_TEAM = BA88US33G6;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
|
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
|
||||||
@@ -368,7 +368,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0.333;
|
MARKETING_VERSION = 1.0.341;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||||
@@ -491,7 +491,7 @@
|
|||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||||
CURRENT_PROJECT_VERSION = 333;
|
CURRENT_PROJECT_VERSION = 341;
|
||||||
DEVELOPMENT_TEAM = BA88US33G6;
|
DEVELOPMENT_TEAM = BA88US33G6;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
|
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
|
||||||
@@ -499,7 +499,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0.333;
|
MARKETING_VERSION = 1.0.341;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||||
@@ -516,7 +516,7 @@
|
|||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||||
CURRENT_PROJECT_VERSION = 333;
|
CURRENT_PROJECT_VERSION = 341;
|
||||||
DEVELOPMENT_TEAM = BA88US33G6;
|
DEVELOPMENT_TEAM = BA88US33G6;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
|
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
|
||||||
@@ -524,7 +524,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0.333;
|
MARKETING_VERSION = 1.0.341;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||||
|
|||||||
38
lib/app.dart
38
lib/app.dart
@@ -23,9 +23,16 @@ class MyApp extends StatelessWidget {
|
|||||||
valueListenable: _setting.themeMode.listenable(),
|
valueListenable: _setting.themeMode.listenable(),
|
||||||
builder: (_, tMode, __) {
|
builder: (_, tMode, __) {
|
||||||
final ok = tMode >= 0 && tMode <= ThemeMode.values.length - 1;
|
final ok = tMode >= 0 && tMode <= ThemeMode.values.length - 1;
|
||||||
final themeMode = ok ? ThemeMode.values[tMode] : ThemeMode.system;
|
// Issue #57
|
||||||
|
// if not [ok] -> [AMOLED] mode, use [ThemeMode.dark]
|
||||||
|
final themeMode = ok ? ThemeMode.values[tMode] : ThemeMode.dark;
|
||||||
final localeStr = _setting.locale.fetch();
|
final localeStr = _setting.locale.fetch();
|
||||||
final locale = localeStr?.toLocale;
|
final locale = localeStr?.toLocale;
|
||||||
|
final darkTheme = ThemeData(
|
||||||
|
useMaterial3: true,
|
||||||
|
brightness: Brightness.dark,
|
||||||
|
colorSchemeSeed: primaryColor,
|
||||||
|
);
|
||||||
|
|
||||||
return MaterialApp(
|
return MaterialApp(
|
||||||
debugShowCheckedModeBanner: false,
|
debugShowCheckedModeBanner: false,
|
||||||
@@ -38,11 +45,30 @@ class MyApp extends StatelessWidget {
|
|||||||
useMaterial3: true,
|
useMaterial3: true,
|
||||||
colorSchemeSeed: primaryColor,
|
colorSchemeSeed: primaryColor,
|
||||||
),
|
),
|
||||||
darkTheme: ThemeData(
|
darkTheme: ok
|
||||||
useMaterial3: true,
|
? darkTheme
|
||||||
brightness: Brightness.dark,
|
: darkTheme.copyWith(
|
||||||
colorSchemeSeed: primaryColor,
|
scaffoldBackgroundColor: Colors.black,
|
||||||
),
|
dialogBackgroundColor: Colors.black,
|
||||||
|
drawerTheme: const DrawerThemeData(
|
||||||
|
backgroundColor: Colors.black,
|
||||||
|
),
|
||||||
|
appBarTheme: const AppBarTheme(
|
||||||
|
backgroundColor: Colors.black,
|
||||||
|
),
|
||||||
|
bottomSheetTheme: const BottomSheetThemeData(
|
||||||
|
backgroundColor: Colors.black,
|
||||||
|
),
|
||||||
|
listTileTheme: const ListTileThemeData(
|
||||||
|
tileColor: Colors.black12,
|
||||||
|
),
|
||||||
|
cardTheme: const CardTheme(
|
||||||
|
color: Colors.black12,
|
||||||
|
),
|
||||||
|
navigationBarTheme: const NavigationBarThemeData(
|
||||||
|
backgroundColor: Colors.black,
|
||||||
|
),
|
||||||
|
),
|
||||||
home: const HomePage(),
|
home: const HomePage(),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
class BuildData {
|
class BuildData {
|
||||||
static const String name = "ServerBox";
|
static const String name = "ServerBox";
|
||||||
static const int build = 333;
|
static const int build = 341;
|
||||||
static const String engine = "3.10.2";
|
static const String engine = "3.10.2";
|
||||||
static const String buildAt = "2023-05-28 19:42:38.911830";
|
static const String buildAt = "2023-05-31 19:23:57.263324";
|
||||||
static const int modifications = 7;
|
static const int modifications = 6;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -142,7 +142,6 @@ class _HomePageState extends State<HomePage>
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
elevation: 0.47,
|
|
||||||
labelBehavior: NavigationDestinationLabelBehavior.onlyShowSelected,
|
labelBehavior: NavigationDestinationLabelBehavior.onlyShowSelected,
|
||||||
destinations: [
|
destinations: [
|
||||||
NavigationDestination(
|
NavigationDestination(
|
||||||
|
|||||||
@@ -149,22 +149,22 @@ class _ServerPageState extends State<ServerPage>
|
|||||||
(pro.servers[e]?.spi.tags?.contains(_tag) ?? false))
|
(pro.servers[e]?.spi.tags?.contains(_tag) ?? false))
|
||||||
.toList();
|
.toList();
|
||||||
return AnimationLimiter(
|
return AnimationLimiter(
|
||||||
key: ValueKey(_tag),
|
key: ValueKey(_tag),
|
||||||
child: ReorderableListView.builder(
|
child: ReorderableListView.builder(
|
||||||
header: _buildTagsSwitcher(pro),
|
header: _buildTagsSwitcher(pro),
|
||||||
padding: const EdgeInsets.fromLTRB(7, 10, 7, 7),
|
padding: const EdgeInsets.fromLTRB(7, 10, 7, 7),
|
||||||
physics: const AlwaysScrollableScrollPhysics(),
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
onReorder: (oldIndex, newIndex) => setState(() {
|
onReorder: (oldIndex, newIndex) => setState(() {
|
||||||
pro.serverOrder.moveById(
|
pro.serverOrder.moveById(
|
||||||
filtered[oldIndex],
|
filtered[oldIndex],
|
||||||
filtered[newIndex],
|
filtered[newIndex],
|
||||||
_settingStore.serverOrder,
|
_settingStore.serverOrder,
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
itemBuilder: (context, index) =>
|
itemBuilder: (context, index) =>
|
||||||
_buildEachServerCard(pro.servers[filtered[index]], index),
|
_buildEachServerCard(pro.servers[filtered[index]], index),
|
||||||
itemCount: filtered.length,
|
itemCount: filtered.length,
|
||||||
));
|
));
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -365,15 +365,17 @@ class _SettingPageState extends State<SettingPage> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildThemeMode() {
|
Widget _buildThemeMode() {
|
||||||
final items = ThemeMode.values.map(
|
final items = ThemeMode.values
|
||||||
(e) {
|
.map(
|
||||||
final str = _buildThemeModeStr(e.index);
|
(e) => PopupMenuItem(
|
||||||
return PopupMenuItem(
|
value: e.index,
|
||||||
value: e.index,
|
child: Text(_buildThemeModeStr(e.index)),
|
||||||
child: Text(str),
|
),
|
||||||
);
|
)
|
||||||
},
|
.toList();
|
||||||
).toList();
|
// Issue #57
|
||||||
|
final len = ThemeMode.values.length;
|
||||||
|
items.add(PopupMenuItem(value: len, child: Text(_buildThemeModeStr(len))));
|
||||||
|
|
||||||
return ListTile(
|
return ListTile(
|
||||||
title: Text(
|
title: Text(
|
||||||
@@ -406,6 +408,8 @@ class _SettingPageState extends State<SettingPage> {
|
|||||||
return _s.light;
|
return _s.light;
|
||||||
case 2:
|
case 2:
|
||||||
return _s.dark;
|
return _s.dark;
|
||||||
|
case 3:
|
||||||
|
return 'AMOLED';
|
||||||
default:
|
default:
|
||||||
return _s.auto;
|
return _s.auto;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,8 +66,16 @@ class TagEditor extends StatelessWidget {
|
|||||||
Widget _buildTagItem(BuildContext context, String tag, bool isAdd) {
|
Widget _buildTagItem(BuildContext context, String tag, bool isAdd) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 3),
|
padding: const EdgeInsets.symmetric(horizontal: 3),
|
||||||
child: GestureDetector(
|
child: InkWell(
|
||||||
onTap: () => _showRenameDialog(context, tag),
|
onTap: () {
|
||||||
|
if (isAdd) {
|
||||||
|
tags.add(tag);
|
||||||
|
} else {
|
||||||
|
tags.remove(tag);
|
||||||
|
}
|
||||||
|
onChanged?.call(tags);
|
||||||
|
},
|
||||||
|
onLongPress: () => _showRenameDialog(context, tag),
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: const BorderRadius.all(Radius.circular(20.0)),
|
borderRadius: const BorderRadius.all(Radius.circular(20.0)),
|
||||||
@@ -82,21 +90,11 @@ class TagEditor extends StatelessWidget {
|
|||||||
style: const TextStyle(color: Colors.white),
|
style: const TextStyle(color: Colors.white),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 4.0),
|
const SizedBox(width: 4.0),
|
||||||
InkWell(
|
Icon(
|
||||||
child: Icon(
|
isAdd ? Icons.add_circle : Icons.cancel,
|
||||||
isAdd ? Icons.add_circle : Icons.cancel,
|
size: 14.0,
|
||||||
size: 14.0,
|
color: Colors.white,
|
||||||
color: Colors.white,
|
),
|
||||||
),
|
|
||||||
onTap: () {
|
|
||||||
if (isAdd) {
|
|
||||||
tags.add(tag);
|
|
||||||
} else {
|
|
||||||
tags.remove(tag);
|
|
||||||
}
|
|
||||||
onChanged?.call(tags);
|
|
||||||
},
|
|
||||||
)
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -475,9 +475,9 @@
|
|||||||
baseConfigurationReference = C1C758C41C4E208965A68933 /* Pods-RunnerTests.debug.xcconfig */;
|
baseConfigurationReference = C1C758C41C4E208965A68933 /* Pods-RunnerTests.debug.xcconfig */;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||||
CURRENT_PROJECT_VERSION = 333;
|
CURRENT_PROJECT_VERSION = 341;
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
MARKETING_VERSION = 1.0.333;
|
MARKETING_VERSION = 1.0.341;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = tech.lolli.serverBox.RunnerTests;
|
PRODUCT_BUNDLE_IDENTIFIER = tech.lolli.serverBox.RunnerTests;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
@@ -490,9 +490,9 @@
|
|||||||
baseConfigurationReference = 15AF97DF993E8968098D6EBE /* Pods-RunnerTests.release.xcconfig */;
|
baseConfigurationReference = 15AF97DF993E8968098D6EBE /* Pods-RunnerTests.release.xcconfig */;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||||
CURRENT_PROJECT_VERSION = 333;
|
CURRENT_PROJECT_VERSION = 341;
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
MARKETING_VERSION = 1.0.333;
|
MARKETING_VERSION = 1.0.341;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = tech.lolli.serverBox.RunnerTests;
|
PRODUCT_BUNDLE_IDENTIFIER = tech.lolli.serverBox.RunnerTests;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
@@ -505,9 +505,9 @@
|
|||||||
baseConfigurationReference = 7CFA7DE7FABA75685DFB6948 /* Pods-RunnerTests.profile.xcconfig */;
|
baseConfigurationReference = 7CFA7DE7FABA75685DFB6948 /* Pods-RunnerTests.profile.xcconfig */;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||||
CURRENT_PROJECT_VERSION = 333;
|
CURRENT_PROJECT_VERSION = 341;
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
MARKETING_VERSION = 1.0.333;
|
MARKETING_VERSION = 1.0.341;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = tech.lolli.serverBox.RunnerTests;
|
PRODUCT_BUNDLE_IDENTIFIER = tech.lolli.serverBox.RunnerTests;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
|
|||||||
26
make.dart
26
make.dart
@@ -8,9 +8,7 @@ const appName = 'ServerBox';
|
|||||||
|
|
||||||
const buildDataFilePath = 'lib/data/res/build_data.dart';
|
const buildDataFilePath = 'lib/data/res/build_data.dart';
|
||||||
const apkPath = 'build/app/outputs/flutter-apk/app-release.apk';
|
const apkPath = 'build/app/outputs/flutter-apk/app-release.apk';
|
||||||
const ipaPath = 'build/ios/ipa/$appName.ipa';
|
|
||||||
const appleXCConfigPath = 'Runner.xcodeproj/project.pbxproj';
|
const appleXCConfigPath = 'Runner.xcodeproj/project.pbxproj';
|
||||||
const releaseDirPath = './release';
|
|
||||||
|
|
||||||
var regAppleProjectVer = RegExp(r'CURRENT_PROJECT_VERSION = .+;');
|
var regAppleProjectVer = RegExp(r'CURRENT_PROJECT_VERSION = .+;');
|
||||||
var regAppleMarketVer = RegExp(r'MARKETING_VERSION = .+');
|
var regAppleMarketVer = RegExp(r'MARKETING_VERSION = .+');
|
||||||
@@ -103,8 +101,7 @@ void flutterRun(String? mode) {
|
|||||||
mode: ProcessStartMode.inheritStdio, runInShell: true);
|
mode: ProcessStartMode.inheritStdio, runInShell: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> flutterBuild(
|
Future<void> flutterBuild(String buildType) async {
|
||||||
String source, String target, String buildType) async {
|
|
||||||
final args = [
|
final args = [
|
||||||
'build',
|
'build',
|
||||||
buildType,
|
buildType,
|
||||||
@@ -126,20 +123,7 @@ Future<void> flutterBuild(
|
|||||||
final buildResult = await fvmRun(['flutter', ...args]);
|
final buildResult = await fvmRun(['flutter', ...args]);
|
||||||
final exitCode = buildResult.exitCode;
|
final exitCode = buildResult.exitCode;
|
||||||
|
|
||||||
if (exitCode == 0) {
|
if (exitCode != 0) {
|
||||||
target = target.replaceFirst('build', build.toString());
|
|
||||||
target = '$releaseDirPath/$target';
|
|
||||||
print('Copying from $source to $target');
|
|
||||||
if (isAndroid) {
|
|
||||||
await File(source).copy(target);
|
|
||||||
} else {
|
|
||||||
final result = await Process.run('cp', ['-r', source, target]);
|
|
||||||
if (result.exitCode != 0) {
|
|
||||||
print(result.stderr);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
print(buildResult.stdout);
|
print(buildResult.stdout);
|
||||||
print(buildResult.stderr);
|
print(buildResult.stderr);
|
||||||
print('\nBuild failed with exit code $exitCode');
|
print('\nBuild failed with exit code $exitCode');
|
||||||
@@ -148,15 +132,15 @@ Future<void> flutterBuild(
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> flutterBuildIOS() async {
|
Future<void> flutterBuildIOS() async {
|
||||||
await flutterBuild(ipaPath, '${appName}_ios_build.ipa', 'ios');
|
await flutterBuild('ipa');
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> flutterBuildMacOS() async {
|
Future<void> flutterBuildMacOS() async {
|
||||||
await flutterBuild(ipaPath, '${appName}_macos_build.ipa', 'macos');
|
await flutterBuild('macos');
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> flutterBuildAndroid() async {
|
Future<void> flutterBuildAndroid() async {
|
||||||
await flutterBuild(apkPath, '${appName}_build_Arm64.apk', 'apk');
|
await flutterBuild('apk');
|
||||||
await killJava();
|
await killJava();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user