mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
fix: ThemeMode not works under copied data
This commit is contained in:
@@ -359,7 +359,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 = 241;
|
CURRENT_PROJECT_VERSION = 243;
|
||||||
DEVELOPMENT_TEAM = BA88US33G6;
|
DEVELOPMENT_TEAM = BA88US33G6;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
@@ -367,7 +367,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0.241;
|
MARKETING_VERSION = 1.0.243;
|
||||||
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";
|
||||||
@@ -490,7 +490,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 = 241;
|
CURRENT_PROJECT_VERSION = 243;
|
||||||
DEVELOPMENT_TEAM = BA88US33G6;
|
DEVELOPMENT_TEAM = BA88US33G6;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
@@ -498,7 +498,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0.241;
|
MARKETING_VERSION = 1.0.243;
|
||||||
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";
|
||||||
@@ -515,7 +515,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 = 241;
|
CURRENT_PROJECT_VERSION = 243;
|
||||||
DEVELOPMENT_TEAM = BA88US33G6;
|
DEVELOPMENT_TEAM = BA88US33G6;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
@@ -523,7 +523,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0.241;
|
MARKETING_VERSION = 1.0.243;
|
||||||
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";
|
||||||
|
|||||||
30
lib/app.dart
30
lib/app.dart
@@ -41,6 +41,8 @@ class MyApp extends StatelessWidget {
|
|||||||
final radioTheme = RadioThemeData(
|
final radioTheme = RadioThemeData(
|
||||||
fillColor: materialColor,
|
fillColor: materialColor,
|
||||||
);
|
);
|
||||||
|
final primarySwatch = primaryColor.materialColor;
|
||||||
|
|
||||||
return ValueListenableBuilder<int>(
|
return ValueListenableBuilder<int>(
|
||||||
valueListenable: _setting.themeMode.listenable(),
|
valueListenable: _setting.themeMode.listenable(),
|
||||||
builder: (_, tMode, __) {
|
builder: (_, tMode, __) {
|
||||||
@@ -51,7 +53,7 @@ class MyApp extends StatelessWidget {
|
|||||||
useMaterial3: false,
|
useMaterial3: false,
|
||||||
fontFamily: fontName,
|
fontFamily: fontName,
|
||||||
primaryColor: primaryColor,
|
primaryColor: primaryColor,
|
||||||
primarySwatch: primaryColor.materialColor,
|
primarySwatch: primarySwatch,
|
||||||
appBarTheme: appBarTheme,
|
appBarTheme: appBarTheme,
|
||||||
floatingActionButtonTheme: fabTheme,
|
floatingActionButtonTheme: fabTheme,
|
||||||
iconTheme: iconTheme,
|
iconTheme: iconTheme,
|
||||||
@@ -60,6 +62,24 @@ class MyApp extends StatelessWidget {
|
|||||||
inputDecorationTheme: inputDecorationTheme,
|
inputDecorationTheme: inputDecorationTheme,
|
||||||
radioTheme: radioTheme,
|
radioTheme: radioTheme,
|
||||||
);
|
);
|
||||||
|
final darkTheme = ThemeData(
|
||||||
|
useMaterial3: false,
|
||||||
|
fontFamily: fontName,
|
||||||
|
primaryColor: primaryColor,
|
||||||
|
primarySwatch: primarySwatch,
|
||||||
|
floatingActionButtonTheme: fabTheme,
|
||||||
|
iconTheme: iconTheme,
|
||||||
|
primaryIconTheme: iconTheme,
|
||||||
|
switchTheme: switchTheme,
|
||||||
|
inputDecorationTheme: inputDecorationTheme,
|
||||||
|
radioTheme: radioTheme,
|
||||||
|
brightness: Brightness.dark,
|
||||||
|
colorScheme: ColorScheme.fromSwatch(
|
||||||
|
primarySwatch: primaryColor.materialColor,
|
||||||
|
brightness: Brightness.dark,
|
||||||
|
accentColor: primaryColor,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
return MaterialApp(
|
return MaterialApp(
|
||||||
debugShowCheckedModeBanner: false,
|
debugShowCheckedModeBanner: false,
|
||||||
@@ -68,13 +88,7 @@ class MyApp extends StatelessWidget {
|
|||||||
title: BuildData.name,
|
title: BuildData.name,
|
||||||
themeMode: themeMode,
|
themeMode: themeMode,
|
||||||
theme: theme,
|
theme: theme,
|
||||||
darkTheme: theme.copyWith(
|
darkTheme: darkTheme,
|
||||||
colorScheme: ColorScheme.fromSwatch(
|
|
||||||
primarySwatch: primaryColor.materialColor,
|
|
||||||
brightness: Brightness.dark,
|
|
||||||
accentColor: primaryColor,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
home: const MyHomePage(),
|
home: const MyHomePage(),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -87,13 +87,11 @@ class ServerProvider extends BusyProvider {
|
|||||||
_servers[i].client?.close();
|
_servers[i].client?.close();
|
||||||
_servers[i].client = null;
|
_servers[i].client = null;
|
||||||
}
|
}
|
||||||
notifyListeners();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final idx = getServerIdx(spi.id);
|
final idx = getServerIdx(spi.id);
|
||||||
_servers[idx].client?.close();
|
_servers[idx].client?.close();
|
||||||
_servers[idx].client = null;
|
_servers[idx].client = null;
|
||||||
notifyListeners();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void addServer(ServerPrivateInfo spi) {
|
void addServer(ServerPrivateInfo spi) {
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
class BuildData {
|
class BuildData {
|
||||||
static const String name = "ServerBox";
|
static const String name = "ServerBox";
|
||||||
static const int build = 241;
|
static const int build = 243;
|
||||||
static const String engine = "Flutter 3.7.7 • channel stable • https://github.com/flutter/flutter.git\nFramework • revision 2ad6cd72c0 (13 days ago) • 2023-03-08 09:41:59 -0800\nEngine • revision 1837b5be5f\nTools • Dart 2.19.4 • DevTools 2.20.1\n";
|
static const String engine = "Flutter 3.7.7 • channel stable • https://github.com/flutter/flutter.git\nFramework • revision 2ad6cd72c0 (13 days ago) • 2023-03-08 09:41:59 -0800\nEngine • revision 1837b5be5f\nTools • Dart 2.19.4 • DevTools 2.20.1\n";
|
||||||
static const String buildAt = "2023-03-21 15:00:34.919375";
|
static const String buildAt = "2023-03-21 15:18:42.802605";
|
||||||
static const int modifications = 6;
|
static const int modifications = 5;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,20 +82,19 @@ Future<void> main() async {
|
|||||||
runInZone(() async {
|
runInZone(() async {
|
||||||
await initApp();
|
await initApp();
|
||||||
runApp(
|
runApp(
|
||||||
RebuildWidget(
|
MultiProvider(
|
||||||
child: MultiProvider(
|
providers: [
|
||||||
providers: [
|
ChangeNotifierProvider(create: (_) => locator<AppProvider>()),
|
||||||
ChangeNotifierProvider(create: (_) => locator<AppProvider>()),
|
ChangeNotifierProvider(create: (_) => locator<PkgProvider>()),
|
||||||
ChangeNotifierProvider(create: (_) => locator<PkgProvider>()),
|
ChangeNotifierProvider(create: (_) => locator<DebugProvider>()),
|
||||||
ChangeNotifierProvider(create: (_) => locator<DebugProvider>()),
|
ChangeNotifierProvider(create: (_) => locator<DockerProvider>()),
|
||||||
ChangeNotifierProvider(create: (_) => locator<DockerProvider>()),
|
ChangeNotifierProvider(create: (_) => locator<ServerProvider>()),
|
||||||
ChangeNotifierProvider(create: (_) => locator<ServerProvider>()),
|
ChangeNotifierProvider(create: (_) => locator<SnippetProvider>()),
|
||||||
ChangeNotifierProvider(create: (_) => locator<SnippetProvider>()),
|
ChangeNotifierProvider(create: (_) => locator<VirtualKeyboard>()),
|
||||||
ChangeNotifierProvider(create: (_) => locator<VirtualKeyboard>()),
|
ChangeNotifierProvider(create: (_) => locator<PrivateKeyProvider>()),
|
||||||
ChangeNotifierProvider(
|
ChangeNotifierProvider(create: (_) => locator<SftpProvider>()),
|
||||||
create: (_) => locator<PrivateKeyProvider>()),
|
],
|
||||||
ChangeNotifierProvider(create: (_) => locator<SftpProvider>()),
|
child: RebuildWidget(
|
||||||
],
|
|
||||||
child: MyApp(),
|
child: MyApp(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ class _MyHomePageState extends State<MyHomePage>
|
|||||||
void dispose() {
|
void dispose() {
|
||||||
super.dispose();
|
super.dispose();
|
||||||
WidgetsBinding.instance.removeObserver(this);
|
WidgetsBinding.instance.removeObserver(this);
|
||||||
|
_serverProvider.closeServer();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
Reference in New Issue
Block a user