From edaf215577adfe51c60581a68941ce6d3678e864 Mon Sep 17 00:00:00 2001 From: Feodor Fitsner Date: Mon, 22 Dec 2025 09:58:10 -0800 Subject: [PATCH] 0.70.0 routing fix (#61) * Update flet dependency to routing-fix branch Changed the flet dependency override to use the 'routing-fix' branch instead of 'main' for testing or applying routing-related fixes. * Add hideWindowOnStart option to app startup Introduces a new hideWindowOnStart configuration option, allowing the app window to be hidden on startup based on project settings. Passes this option to setupDesktop for improved control over window visibility during launch. * Remove unused setupDesktop function Deleted the setupDesktop function from main.dart as it is no longer used. This helps clean up the codebase and removes unnecessary platform-specific initialization logic. * Update serious_python and flet dependencies Bump serious_python to version 0.9.7 and update flet dependency override to use the main branch. Also comment out the serious_python git override. * Enable serious_python with updated git reference Uncommented the serious_python dependency and updated its git reference to use the 'android-logging-fix' branch. This change ensures the project uses the latest fixes from the serious_python repository. * Update flet dependency to video-crash-fix branch Changed the flet dependency override to use the 'video-crash-fix' branch instead of 'main' to address video-related issues. * Update flet dependency to use main branch Changed the flet dependency override from the 'video-crash-fix' branch to the 'main' branch in pubspec.yaml. This ensures the project uses the latest stable code from the main branch. * Update serious_python to version 0.9.8 Bump serious_python dependency from 0.9.7 to 0.9.8 and comment out the git override for serious_python in pubspec.yaml. --- {{cookiecutter.out_dir}}/lib/main.dart | 31 ++++++-------------------- {{cookiecutter.out_dir}}/pubspec.yaml | 14 +++++------- 2 files changed, 13 insertions(+), 32 deletions(-) diff --git a/{{cookiecutter.out_dir}}/lib/main.dart b/{{cookiecutter.out_dir}}/lib/main.dart index 366c691..0c2f0f0 100644 --- a/{{cookiecutter.out_dir}}/lib/main.dart +++ b/{{cookiecutter.out_dir}}/lib/main.dart @@ -31,10 +31,14 @@ import 'package:{{ dep }}/{{ dep }}.dart' as {{ dep }}; {% set startup_screen_message = get_pyproject("tool.flet." ~ cookiecutter.options.config_platform ~ ".app.startup_screen.message") or get_pyproject("tool.flet.app.startup_screen.message") %} +{% set hide_window_on_start = get_pyproject("tool.flet." ~ cookiecutter.options.config_platform ~ ".app.hide_window_on_start") + or get_pyproject("tool.flet.app.hide_window_on_start") %} + show_boot_screen: {{ show_boot_screen }} boot_screen_message: {{ boot_screen_message }} show_startup_screen: {{ show_startup_screen }} startup_screen_message: {{ startup_screen_message }} +hide_window_on_start: {{ hide_window_on_start }} */ const bool isRelease = bool.fromEnvironment('dart.vm.product'); @@ -45,6 +49,7 @@ final showAppBootScreen = bool.tryParse("{{ show_boot_screen }}".toLowerCase()) const appBootScreenMessage = '{{ boot_screen_message | default("Preparing the app for its first launch…", true) }}'; final showAppStartupScreen = bool.tryParse("{{ show_startup_screen }}".toLowerCase()) ?? false; const appStartupScreenMessage = '{{ startup_screen_message | default("Getting things ready…", true) }}'; +final hideWindowOnStart = bool.tryParse("{{ hide_window_on_start }}".toLowerCase()) ?? false; List extensions = [ {% for dep in cookiecutter.flutter.dependencies %} @@ -127,7 +132,7 @@ Future prepareApp() async { _args.remove("--debug"); } - await setupDesktop(); + await setupDesktop(hideWindowOnStart: hideWindowOnStart); if (kIsWeb) { // web mode - connect via HTTP @@ -368,26 +373,4 @@ Future getUnusedPort() { socket.close(); return port; }); -} - -Future setupDesktop() async { - if (isDesktopPlatform()) { - WidgetsFlutterBinding.ensureInitialized(); - await windowManager.ensureInitialized(); - - Map env = Platform.environment; - var hideWindowOnStart = env["FLET_HIDE_WINDOW_ON_START"]; - var hideAppOnStart = env["FLET_HIDE_APP_ON_START"]; - debugPrint("hideWindowOnStart: $hideWindowOnStart"); - debugPrint("hideAppOnStart: $hideAppOnStart"); - - await windowManager.waitUntilReadyToShow(null, () async { - if (hideWindowOnStart == null && hideAppOnStart == null) { - await windowManager.show(); - await windowManager.focus(); - } else if (hideAppOnStart != null) { - await windowManager.setSkipTaskbar(true); - } - }); - } -} +} \ No newline at end of file diff --git a/{{cookiecutter.out_dir}}/pubspec.yaml b/{{cookiecutter.out_dir}}/pubspec.yaml index 5c56d8c..e23469d 100644 --- a/{{cookiecutter.out_dir}}/pubspec.yaml +++ b/{{cookiecutter.out_dir}}/pubspec.yaml @@ -13,7 +13,7 @@ dependencies: flutter_web_plugins: sdk: flutter - serious_python: 0.9.6 + serious_python: 0.9.8 battery_plus: ^7.0.0 connectivity_plus: ^7.0.0 @@ -40,13 +40,11 @@ dependency_overrides: ref: main url: https://github.com/flet-dev/flet.git - #serious_python: 0.9.6 - - serious_python: - git: - url: https://github.com/flet-dev/serious-python.git - ref: android10-fix - path: src/serious_python + # serious_python: + # git: + # url: https://github.com/flet-dev/serious-python.git + # ref: android-logging-fix + # path: src/serious_python package_info_plus: ^9.0.0 wakelock_plus: ^1.4.0