GardenMobile & interfaces

An older Flutter fullscreen lifecycle snippet

Hiding system overlays on entry and restoring a state on disposal in an earlier API.

The original fullscreen screen changed system overlays during initialization and changed them again on disposal:

@override
void initState() {
  super.initState();
  // Fullscreen mode
  SystemChrome.setEnabledSystemUIOverlays(<SystemUiOverlay>[]);
}

@override
void dispose() {
  // Disable fullscreen mode
  SystemChrome.setEnabledSystemUIOverlays(SystemUiOverlay.values);
  super.dispose();
}

The API name belongs to an older Flutter generation. Restoring every overlay is also different from restoring the exact previous UI state. Nested routes and asynchronous platform changes can make ownership important.

This is a small historical lifecycle example. It was not adapted to a current system-UI API or run on a device for this revision.

← Back to the garden