From aa85834ccd378e7b4fd593927b3acf3b3e662494 Mon Sep 17 00:00:00 2001 From: bl1nc <130155870+bl1nch@users.noreply.github.com> Date: Tue, 9 Jul 2024 08:37:00 +0600 Subject: [PATCH 1/3] Window fullscreen on mobile devices and web (https://pub.dev/packages/fullscreen_window) --- packages/flet/lib/src/controls/page.dart | 7 ++++++- packages/flet/pubspec.yaml | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/flet/lib/src/controls/page.dart b/packages/flet/lib/src/controls/page.dart index d26f530f6..9d5259a6f 100644 --- a/packages/flet/lib/src/controls/page.dart +++ b/packages/flet/lib/src/controls/page.dart @@ -11,6 +11,7 @@ import 'package:flutter/services.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_redux/flutter_redux.dart'; import 'package:redux/redux.dart'; +import 'package:fullscreen_window/fullscreen_window.dart'; import '../actions.dart'; import '../flet_app_context.dart'; @@ -486,7 +487,11 @@ class _PageControlState extends State with FletStoreMixin { // windowFullScreen if (windowFullScreen != null && windowFullScreen != _windowFullScreen) { - await setWindowFullScreen(windowFullScreen); + if (isDesktop()) { + await setWindowFullScreen(windowFullScreen); + } else { + FullScreenWindow.setFullScreen(windowFullScreen); + } _windowFullScreen = windowFullScreen; } diff --git a/packages/flet/pubspec.yaml b/packages/flet/pubspec.yaml index ddd43c345..56b4d8407 100644 --- a/packages/flet/pubspec.yaml +++ b/packages/flet/pubspec.yaml @@ -42,6 +42,7 @@ dependencies: path: ^1.8.2 js: ^0.6.5 fl_chart: ^0.69.0 + fullscreen_window: ^1.1.0 dev_dependencies: flutter_test: From f0d8ab50c772c727e5cd315e382d30a3e37790fb Mon Sep 17 00:00:00 2001 From: Feodor Fitsner Date: Mon, 29 Jul 2024 15:26:38 -0700 Subject: [PATCH 2/3] force web 1.0.0 --- client/pubspec.lock | 10 +++++++++- client/windows/flutter/generated_plugin_registrant.cc | 3 +++ client/windows/flutter/generated_plugins.cmake | 1 + packages/flet/pubspec.yaml | 3 +++ 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/client/pubspec.lock b/client/pubspec.lock index 0b814b425..e7e47ab41 100644 --- a/client/pubspec.lock +++ b/client/pubspec.lock @@ -435,6 +435,14 @@ packages: description: flutter source: sdk version: "0.0.0" + fullscreen_window: + dependency: transitive + description: + name: fullscreen_window + sha256: b3502f890a875de6cd300b06cfc542e089a324faef6c4fb5d5528f9e2ea68d8d + url: "https://pub.dev" + source: hosted + version: "1.1.0" geolocator: dependency: transitive description: @@ -1430,7 +1438,7 @@ packages: source: hosted version: "1.2.1" web: - dependency: transitive + dependency: "direct overridden" description: name: web sha256: d43c1d6b787bf0afad444700ae7f4db8827f701bc61c255ac8d328c6f4d52062 diff --git a/client/windows/flutter/generated_plugin_registrant.cc b/client/windows/flutter/generated_plugin_registrant.cc index be1578b39..1e7a9f0dd 100644 --- a/client/windows/flutter/generated_plugin_registrant.cc +++ b/client/windows/flutter/generated_plugin_registrant.cc @@ -7,6 +7,7 @@ #include "generated_plugin_registrant.h" #include +#include #include #include #include @@ -22,6 +23,8 @@ void RegisterPlugins(flutter::PluginRegistry* registry) { AudioplayersWindowsPluginRegisterWithRegistrar( registry->GetRegistrarForPlugin("AudioplayersWindowsPlugin")); + FullscreenWindowPluginCApiRegisterWithRegistrar( + registry->GetRegistrarForPlugin("FullscreenWindowPluginCApi")); GeolocatorWindowsRegisterWithRegistrar( registry->GetRegistrarForPlugin("GeolocatorWindows")); MediaKitLibsWindowsVideoPluginCApiRegisterWithRegistrar( diff --git a/client/windows/flutter/generated_plugins.cmake b/client/windows/flutter/generated_plugins.cmake index 61e94283e..eef7d0d50 100644 --- a/client/windows/flutter/generated_plugins.cmake +++ b/client/windows/flutter/generated_plugins.cmake @@ -4,6 +4,7 @@ list(APPEND FLUTTER_PLUGIN_LIST audioplayers_windows + fullscreen_window geolocator_windows media_kit_libs_windows_video media_kit_video diff --git a/packages/flet/pubspec.yaml b/packages/flet/pubspec.yaml index 56b4d8407..fc16ed471 100644 --- a/packages/flet/pubspec.yaml +++ b/packages/flet/pubspec.yaml @@ -44,6 +44,9 @@ dependencies: fl_chart: ^0.69.0 fullscreen_window: ^1.1.0 +dependency_overrides: + web: ^1.0.0 + dev_dependencies: flutter_test: sdk: flutter From fa6bb29ae1ecc529416046853a8f48f0dcd2762a Mon Sep 17 00:00:00 2001 From: bl1nch <130155870+bl1nch@users.noreply.github.com> Date: Tue, 26 Nov 2024 10:50:52 +0600 Subject: [PATCH 3/3] isDesktopPlatform --- packages/flet/lib/src/controls/page.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/flet/lib/src/controls/page.dart b/packages/flet/lib/src/controls/page.dart index 9d5259a6f..4209837bb 100644 --- a/packages/flet/lib/src/controls/page.dart +++ b/packages/flet/lib/src/controls/page.dart @@ -487,7 +487,7 @@ class _PageControlState extends State with FletStoreMixin { // windowFullScreen if (windowFullScreen != null && windowFullScreen != _windowFullScreen) { - if (isDesktop()) { + if (isDesktopPlatform()) { await setWindowFullScreen(windowFullScreen); } else { FullScreenWindow.setFullScreen(windowFullScreen);