Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enter full screen mode in Flutter web app

Is there a way of making a flutter web app enter fullscreen mode (hide addressbar, tabsbar and taskbar)? Or is there a way of programmatically pressing F11?

I've tried...

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

@override
initState() {
  SystemChrome.setEnabledSystemUIOverlays([]);
  super.initState();
}

but it didn't work in the web app (I wasn't expecting it to)

like image 854
JakesMD Avatar asked Dec 13 '22 08:12

JakesMD


2 Answers

You might try this:

import 'dart:html';

void goFullScreen() {
  document.documentElement.requestFullscreen();
}
like image 90
Abion47 Avatar answered Dec 20 '22 04:12

Abion47


If somebody (like me) wants to exit the fullscreen and struggles to find how:

void exitFullScreen() {
 document.exitFullscreen();
}

Hope that's useful.

like image 22
Top4o Avatar answered Dec 20 '22 03:12

Top4o