Skip to content

Commit 78e6096

Browse files
committed
initial commit
1 parent 42dcc71 commit 78e6096

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

packages/flet/lib/src/controls/page.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import 'package:flutter/material.dart';
99
import 'package:flutter/rendering.dart';
1010
import 'package:flutter/services.dart';
1111
import 'package:flutter_localizations/flutter_localizations.dart';
12+
import 'package:fullscreen_window/fullscreen_window.dart';
1213
import 'package:provider/provider.dart';
1314

1415
import '../extensions/control.dart';
@@ -197,6 +198,12 @@ class _PageControlState extends State<PageControl> with WidgetsBindingObserver {
197198
await SystemChrome.setPreferredOrientations(orientations);
198199
}
199200
break;
201+
case "set_fullscreen":
202+
final value = parseBool(args["value"]);
203+
if (value != null) {
204+
await FullScreenWindow.setFullScreen(value);
205+
}
206+
break;
200207

201208
default:
202209
throw Exception("Unknown Page method: $name");

packages/flet/pubspec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ dependencies:
2828
flutter_highlight: 0.7.0
2929
flutter_markdown: 0.7.6+2
3030
flutter_svg: 2.2.1
31+
fullscreen_window: ^1.2.0
3132
highlight: ^0.7.0
3233
http: 1.5.0
3334
markdown: 7.3.0

sdk/python/packages/flet/src/flet/controls/page.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,22 @@ class Page(BasePage):
330330
The operating system the application is running on.
331331
"""
332332

333+
@property
334+
def fullscreen(self) -> bool:
335+
"""
336+
Requests fullscreen mode for the host window or browser.
337+
338+
Set to `True` to hide the host system chrome; set to `False` to restore it.
339+
"""
340+
return getattr(self, "_fullscreen", False)
341+
342+
@fullscreen.setter
343+
def fullscreen(self, value: bool) -> None:
344+
self._fullscreen = value
345+
asyncio.create_task(
346+
self._invoke_method("set_fullscreen", arguments={"value": value})
347+
)
348+
333349
fonts: Optional[dict[str, str]] = None
334350
"""
335351
Defines the custom fonts to be used in the application.

0 commit comments

Comments
 (0)