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