enterFullScreen static method
To enable fullscreen mode, pass the fullscreen mode as an argument the the enterFullScreen method of the FullScreen class.
Implementation
static Future<void> enterFullScreen(FullScreenMode fullScreenMode) async {
if (Platform.isIOS) {
SystemChrome.setEnabledSystemUIOverlays([]);
} else if (Platform.isAndroid) {
try {
if (fullScreenMode == FullScreenMode.EMERSIVE) {
await _channel.invokeMethod('emersive');
} else if (fullScreenMode == FullScreenMode.EMERSIVE_STICKY) {
await _channel.invokeMethod('emersiveSticky');
} else if (fullScreenMode == FullScreenMode.LEANBACK) {
await _channel.invokeMethod('leanBack');
}
} catch (e) {
print(e);
}
}
}