Make flutter application fullscreen
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.`