How do I remove the navbar in Flutter for Android

Viewed 111

See image below, there is a semi transparent nav type bar by default when starting a fresh app on flutter dev that I wish to remove with no idea where to look in the docs.

The problem

2 Answers

You can either set its color to transparent like this:

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

Or you can hide it completely like this:

SystemChrome.setEnabledSystemUIOverlays([SystemUiOverlay.bottom]);

First of all import 'package:flutter/services.dart';

Then where you need you can write the below code. Also, if you need throughout the app the you can write it in void main().

SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
    statusBarBrightness: Brightness.light,
    statusBarIconBrightness: Brightness.light,
    statusBarColor: Colors.transparent,
  ));

Depending on your need you can change Brightness for statusBar as well as its icons.

Related