diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index c730679b..7bf6f415 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -470,7 +470,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 526; + CURRENT_PROJECT_VERSION = 529; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; @@ -478,7 +478,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.526; + MARKETING_VERSION = 1.0.529; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -602,7 +602,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 526; + CURRENT_PROJECT_VERSION = 529; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; @@ -610,7 +610,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.526; + MARKETING_VERSION = 1.0.529; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -628,7 +628,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 526; + CURRENT_PROJECT_VERSION = 529; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; @@ -636,7 +636,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.526; + MARKETING_VERSION = 1.0.529; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -657,7 +657,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 526; + CURRENT_PROJECT_VERSION = 529; DEVELOPMENT_TEAM = BA88US33G6; GCC_C_LANGUAGE_STANDARD = gnu11; GENERATE_INFOPLIST_FILE = YES; @@ -670,7 +670,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.526; + MARKETING_VERSION = 1.0.529; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget; @@ -696,7 +696,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 526; + CURRENT_PROJECT_VERSION = 529; DEVELOPMENT_TEAM = BA88US33G6; GCC_C_LANGUAGE_STANDARD = gnu11; GENERATE_INFOPLIST_FILE = YES; @@ -709,7 +709,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.526; + MARKETING_VERSION = 1.0.529; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -732,7 +732,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 526; + CURRENT_PROJECT_VERSION = 529; DEVELOPMENT_TEAM = BA88US33G6; GCC_C_LANGUAGE_STANDARD = gnu11; GENERATE_INFOPLIST_FILE = YES; @@ -745,7 +745,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.526; + MARKETING_VERSION = 1.0.529; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/lib/app.dart b/lib/app.dart index b34f9046..0c84ba1f 100644 --- a/lib/app.dart +++ b/lib/app.dart @@ -33,6 +33,14 @@ class MyApp extends StatelessWidget { useMaterial3: true, brightness: Brightness.dark, colorSchemeSeed: primaryColor, + + /// After upgrading to flutter 3.13, + /// the shadow color of the drawer is white (maybe a bug). + /// TODO: remember to remove it after the bug is fixed. + drawerTheme: const DrawerThemeData( + backgroundColor: Colors.black, + shadowColor: Colors.black12, + ), ); return MaterialApp( @@ -57,8 +65,6 @@ class MyApp extends StatelessWidget { ThemeData _getAmoledTheme(ThemeData darkTheme) => darkTheme.copyWith( scaffoldBackgroundColor: Colors.black, dialogBackgroundColor: Colors.black, - drawerTheme: const DrawerThemeData( - backgroundColor: Colors.black, shadowColor: Colors.black), appBarTheme: const AppBarTheme(backgroundColor: Colors.black), dialogTheme: const DialogTheme(backgroundColor: Colors.black), bottomSheetTheme: diff --git a/lib/data/res/build_data.dart b/lib/data/res/build_data.dart index 4fd06548..5633cb0f 100644 --- a/lib/data/res/build_data.dart +++ b/lib/data/res/build_data.dart @@ -2,8 +2,8 @@ class BuildData { static const String name = "ServerBox"; - static const int build = 526; - static const String engine = "3.13.1"; - static const String buildAt = "2023-09-05 21:15:22.219124"; - static const int modifications = 2; + static const int build = 529; + static const String engine = "3.13.2"; + static const String buildAt = "2023-09-06 21:16:27.707712"; + static const int modifications = 4; } diff --git a/lib/view/page/editor.dart b/lib/view/page/editor.dart index 3a4d23c2..6b931635 100644 --- a/lib/view/page/editor.dart +++ b/lib/view/page/editor.dart @@ -1,7 +1,6 @@ import 'dart:async'; import 'dart:io'; -import 'package:after_layout/after_layout.dart'; import 'package:code_text_field/code_text_field.dart'; import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/l10n.dart'; @@ -44,14 +43,16 @@ class EditorPage extends StatefulWidget { _EditorPageState createState() => _EditorPageState(); } -class _EditorPageState extends State with AfterLayoutMixin { - late CodeController _controller; - late final _focusNode = FocusNode(); +class _EditorPageState extends State { + final _focusNode = FocusNode(); final _setting = locator(); + + late CodeController _controller; late Map _codeTheme; late S _s; - late String? _langCode; - late TextStyle _textStyle; + late final _textStyle = TextStyle(fontSize: _setting.editorFontSize.fetch()); + + String? _langCode; @override void initState() { @@ -62,7 +63,16 @@ class _EditorPageState extends State with AfterLayoutMixin { _controller = CodeController( language: suffix2HighlightMap[_langCode], ); - _textStyle = TextStyle(fontSize: _setting.editorFontSize.fetch()); + + /// TODO: This is a temporary solution to avoid the loading stuck + Future.delayed(const Duration(milliseconds: 377)).then((value) async { + if (widget.path != null) { + final code = await File(widget.path!).readAsString(); + _controller.text = code; + } else if (widget.text != null) { + _controller.text = widget.text!; + } + }); } @override @@ -115,7 +125,7 @@ class _EditorPageState extends State with AfterLayoutMixin { return CustomAppBar( centerTitle: true, title: TwoLineText( - up: widget.title ?? getFileName(widget.path) ?? '', + up: widget.title ?? getFileName(widget.path) ?? _s.unknown, down: _s.editor, ), actions: [ @@ -156,16 +166,4 @@ class _EditorPageState extends State with AfterLayoutMixin { ), )); } - - @override - FutureOr afterFirstLayout(BuildContext context) async { - /// TODO: This is a temporary solution to avoid the loading stuck - await Future.delayed(const Duration(milliseconds: 377)); - if (widget.path != null) { - final code = await File(widget.path!).readAsString(); - _controller.text = code; - } else if (widget.text != null) { - _controller.text = widget.text!; - } - } } diff --git a/lib/view/page/home.dart b/lib/view/page/home.dart index 26228f3a..bb74dec6 100644 --- a/lib/view/page/home.dart +++ b/lib/view/page/home.dart @@ -370,6 +370,15 @@ class _HomePageState extends State if (result == null) { return; } - _setting.box.putAll(json.decode(result) as Map); + try { + final newSettings = json.decode(result) as Map; + _setting.box.putAll(newSettings); + } catch (e) { + showRoundDialog( + context: context, + title: Text(_s.error), + child: Text('${_s.save}:\n$e'), + ); + } } } diff --git a/lib/view/page/server/detail.dart b/lib/view/page/server/detail.dart index 4ed07df7..6c56e115 100644 --- a/lib/view/page/server/detail.dart +++ b/lib/view/page/server/detail.dart @@ -320,7 +320,11 @@ class _ServerDetailPageState extends State style: textSize11, textScaleFactor: _textFactor, ), - Text(disk.path, style: textSize11, textScaleFactor: _textFactor,) + Text( + disk.path, + style: textSize11, + textScaleFactor: _textFactor, + ) ], ), _buildProgress(disk.usedPercent.toDouble()) diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj index b0553663..745128af 100644 --- a/macos/Runner.xcodeproj/project.pbxproj +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -474,9 +474,9 @@ baseConfigurationReference = C1C758C41C4E208965A68933 /* Pods-RunnerTests.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; - CURRENT_PROJECT_VERSION = 526; + CURRENT_PROJECT_VERSION = 529; GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0.526; + MARKETING_VERSION = 1.0.529; PRODUCT_BUNDLE_IDENTIFIER = tech.lolli.serverBox.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; @@ -489,9 +489,9 @@ baseConfigurationReference = 15AF97DF993E8968098D6EBE /* Pods-RunnerTests.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; - CURRENT_PROJECT_VERSION = 526; + CURRENT_PROJECT_VERSION = 529; GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0.526; + MARKETING_VERSION = 1.0.529; PRODUCT_BUNDLE_IDENTIFIER = tech.lolli.serverBox.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; @@ -504,9 +504,9 @@ baseConfigurationReference = 7CFA7DE7FABA75685DFB6948 /* Pods-RunnerTests.profile.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; - CURRENT_PROJECT_VERSION = 526; + CURRENT_PROJECT_VERSION = 529; GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0.526; + MARKETING_VERSION = 1.0.529; PRODUCT_BUNDLE_IDENTIFIER = tech.lolli.serverBox.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0;