File tree Expand file tree Collapse file tree 3 files changed +24
-0
lines changed
sdk/python/packages/flet/src/flet/controls Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import 'package:flutter/material.dart';
99import 'package:flutter/rendering.dart' ;
1010import 'package:flutter/services.dart' ;
1111import 'package:flutter_localizations/flutter_localizations.dart' ;
12+ import 'package:fullscreen_window/fullscreen_window.dart' ;
1213import 'package:provider/provider.dart' ;
1314
1415import '../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 " );
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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.
You can’t perform that action at this time.
0 commit comments