1
2
3
4
5
6
7
8
9
10
import "package:flutter/material.dart";
import 'package:flutter/services.dart';

void main() {
  SystemChrome.setEnabledSystemUIOverlays([]);// StatusBar 숨기기

  runApp(MaterialApp(
    debugShowCheckedModeBanner: false, // Debug 배너 제거
  ));
}

버튼을 눌렀을 때 StatusBar 상태를 바꾸려면…

1
2
3
4
5
6
bool _statusBarHidden = true;

RaisedButton(onPressed: (){
  SystemChrome.setEnabledSystemUIOverlays(_statusBarHidden ? SystemUiOverlay.values : []);
  _statusBarHidden = !_statusBarHidden;
}