Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Window fullscreen on mobile devices and web #3620

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion client/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -1430,7 +1438,7 @@ packages:
source: hosted
version: "1.2.1"
web:
dependency: transitive
dependency: "direct overridden"
description:
name: web
sha256: d43c1d6b787bf0afad444700ae7f4db8827f701bc61c255ac8d328c6f4d52062
Expand Down
3 changes: 3 additions & 0 deletions client/windows/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "generated_plugin_registrant.h"

#include <audioplayers_windows/audioplayers_windows_plugin.h>
#include <fullscreen_window/fullscreen_window_plugin_c_api.h>
#include <geolocator_windows/geolocator_windows.h>
#include <media_kit_libs_windows_video/media_kit_libs_windows_video_plugin_c_api.h>
#include <media_kit_video/media_kit_video_plugin_c_api.h>
Expand All @@ -22,6 +23,8 @@
void RegisterPlugins(flutter::PluginRegistry* registry) {
AudioplayersWindowsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("AudioplayersWindowsPlugin"));
FullscreenWindowPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FullscreenWindowPluginCApi"));
GeolocatorWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("GeolocatorWindows"));
MediaKitLibsWindowsVideoPluginCApiRegisterWithRegistrar(
Expand Down
1 change: 1 addition & 0 deletions client/windows/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

list(APPEND FLUTTER_PLUGIN_LIST
audioplayers_windows
fullscreen_window
geolocator_windows
media_kit_libs_windows_video
media_kit_video
Expand Down
7 changes: 6 additions & 1 deletion packages/flet/lib/src/controls/page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -486,7 +487,11 @@ class _PageControlState extends State<PageControl> with FletStoreMixin {

// windowFullScreen
if (windowFullScreen != null && windowFullScreen != _windowFullScreen) {
await setWindowFullScreen(windowFullScreen);
if (isDesktopPlatform()) {
await setWindowFullScreen(windowFullScreen);
} else {
FullScreenWindow.setFullScreen(windowFullScreen);
}
_windowFullScreen = windowFullScreen;
}

Expand Down
4 changes: 4 additions & 0 deletions packages/flet/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ dependencies:
path: ^1.8.2
js: ^0.6.5
fl_chart: ^0.69.0
fullscreen_window: ^1.1.0

dependency_overrides:
web: ^1.0.0

dev_dependencies:
flutter_test:
Expand Down