Make flutter application fullscreen Make flutter application fullscreen dart dart

Make flutter application fullscreen


It's exactly like for Android status bar.

Doing SystemChrome.setEnabledSystemUIOverlays([]) hides both the status bar and the navigation bar.

p/s : use thisSystemChrome.setEnabledSystemUIOverlays(SystemUiOverlay.values); to disable full screen mode.


// to hide only bottom bar:SystemChrome.setEnabledSystemUIOverlays ([SystemUiOverlay.top]);// to hide only status bar: SystemChrome.setEnabledSystemUIOverlays ([SystemUiOverlay.bottom]);// to hide both:SystemChrome.setEnabledSystemUIOverlays ([]);


Finally i found a way to set in one class for fullscreen. and disable on other classes.

To set full screen put this code in initState()

SystemChrome.setEnabledSystemUIOverlays([]);

and to set back to normal. In dispose()

SystemChrome.setEnabledSystemUIOverlays(SystemUiOverlay.values);

in the same class.

@override  void dispose() {        SystemChrome.setEnabledSystemUIOverlays(SystemUiOverlay.values);    super.dispose();  }      @override  initState() {      SystemChrome.setEnabledSystemUIOverlays([]);    super.initState();  }

you can't set the

SystemChrome.restoreSystemUIOverlays();

in dispose(). because its already saying

**Restores the system overlays to the last settings provided via [setEnabledSystemUIOverlays].**May be used when the platform force enables/disables UI elements.          For example, when the Android keyboard disables hidden status and navigation bars,this can be called to re-disable the bars when the keyboard is closed.          On Android, the system UI cannot be changed until 1 second after the previouschange. This is to prevent malware from permanently hiding navigation buttons.`