How to hide Android StatusBar in Flutter

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

  }

import 'package:flutter/services.dart';

1.Hide Statusbar

SystemChrome.setEnabledSystemUIMode([SystemUiOverlay.bottom])

enter image description here

2. Transparant Statusbar

 SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
    statusBarColor: Colors.transparent,
 ));

enter image description here

3.Show Statusbar

SystemChrome.setEnabledSystemUIOverlays(SystemUiOverlay.values);

You need to put this code on :

1.For Single Screen

@override
  void initState() {
    // put it here
    super.initState();
  }

2.For All pages in main.dart:

 void main() {
      // put it here
      runApp(...);
  }

Tags:

Flutter