12

I used SystemChrome.setEnabledSystemUIOverlays([]); to make my flutter app full screen.

The status bar is gone for good, but I get this white space at the bottom where the nav bar used to be.

image

Aasiz
  • 647
  • 8
  • 18

4 Answers4

16

You can set resizeToAvoidBottomPadding to false on Scaffold

Scaffold(
  resizeToAvoidBottomPadding: false,
  appBar: new AppBar(),
);
Rémi Rousselet
  • 256,336
  • 79
  • 519
  • 432
  • @Rémi It does hide the bottom navigation bar but after screen is touched, navigation bar comes up again and stays forever. I know in Android, we can do `getWindow().setFlags(...)` but I was thinking of some way to handle it in flutter. – CopsOnRoad Oct 28 '18 at 14:46
4

this code work for me, thx

@override
 Widget build(BuildContext context) {
    SystemChrome.setEnabledSystemUIOverlays([]);
    return Scaffold(
      resizeToAvoidBottomPadding: false
    )
 }

resizeToAvoidBottomPadding has been deprecated and now you have to use resizeToAvoidBottomInset

Updated code below:

@override
 Widget build(BuildContext context) {
    SystemChrome.setEnabledSystemUIOverlays([]);
    return Scaffold(
      resizeToAvoidBottomInset: false
    )
 }
petras J
  • 2,538
  • 3
  • 16
  • 23
gandalivs
  • 383
  • 3
  • 4
1

I used resizeToAvoidBottomPadding = false but sometimes there's white padding at where navigation bar is. It's inconsistent, sometime it's shown, sometimes it's not

Nartus Team
  • 170
  • 1
  • 7
-2

use SystemChrome.setEnabledSystemUIOverlays([]); in your widget,it will work perfect:

@override
  Widget build(BuildContext context) {

    // To make this screen full screen.
    // It will hide status bar and notch.
    SystemChrome.setEnabledSystemUIOverlays([]);

    // full screen image for splash screen.
    return Container(
            child: new Image.asset('assets/splash.png', fit: BoxFit.fill));
      }
    }

and remember to import this

import 'package:flutter/services.dart';
Zoha Shobbar
  • 446
  • 8
  • 17