Hossam Aboud
Hossam Aboud

Reputation: 27

flutter : hide status bar (bottom)

I have a design in adobe xd. I want to apply it to flutter. The application should not have a status bar bottom in all layout screens. I added this code in the main:

main code :

void main() {
  SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual,
       overlays: [SystemUiOverlay.top]);
  runApp(const MyApp());
}

status bar bottom has actually disappeared but when I press a button to enter another screen it appears first on the first click and when I press again it moves to the other screen and remains visible and does not disappear even though I put the status bar bottom code in the main

These attached pictures illustrate my explanation above in full: : First, as soon as the application is launched, the status bar bottom disappears enter image description here

Upvotes: 0

Views: 2196

Answers (1)

Babul
Babul

Reputation: 1224

import 'package:flutter/services.dart';

Hide Statusbar

SystemChrome.setEnabledSystemUIMode([SystemUiOverlay.bottom])

For Single Screen

@override
  void initState() {
    // put hide code here to hide statusbar
    super.initState();
  }

Upvotes: 1

Related Questions