Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide Android StatusBar in Flutter

Tags:

flutter

How to hide the Android Status Bar in a Flutter App?

Android Status Bar

like image 473
Pieter Avatar asked May 09 '17 18:05

Pieter


People also ask

How do I get rid of AppBar Flutter?

The right and simplest way to remove back button on Appbar in Flutter is to set the automaticallyImplyLeading property of the AppBar to false and replace the old screen in a stack with the current/new screen.

How do I remove kotlin status bar?

To hide status bar in Android using Kotlin, we can request that the visibility of the status bar or other screen/window decorations be changed by setting window. decorView. systemUiVisibility with View. SYSTEM_UI_FLAG_FULLSCREEN in the Activity Kotlin file.


1 Answers

SystemChrome.setEnabledSystemUIOverlays([]) should do what you want.

You can bring it back with SystemChrome.setEnabledSystemUIOverlays(SystemUiOverlay.values).

Import it using

import 'package:flutter/services.dart'; 

Update answer (from Flutter 2.5 or latest):

SystemChrome.setEnabledSystemUIMode(SystemUiMode.leanBack); 

Or you can use another options like:

SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: [   SystemUiOverlay.bottom ]);  // to hide only bottom bar 

Then when you need to re-show it (like when dispose) use this:

  @override   void dispose() {     super.dispose();      SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: SystemUiOverlay.values);  // to re-show bars    } 
like image 125
Collin Jackson Avatar answered Sep 28 '22 04:09

Collin Jackson