469
votes

How to remove the debug banner in flutter?

I am using flutter screenshot and I would like the screenshot not to have banner. Now it does have.

Note that I get not supported for emulator message for profile and release mode.

12
debugShowCheckedModeBanner: falsexgqfrms
add debugShowCheckModeBanner:false in MaterialApp() Widget and that should remove the banner on hot reloadMahesh Jamdade
Theres a difference between a comment and an answer also look at the timestamp it was named early whenbthere were not many answersMahesh Jamdade
There is nothing wrong with this question. Voted to re-open it.Bitcoin Cash - ADA enthusiast
debugShowCheckModeBanner: false in MaterialApp - most used one. You can also disable it using Android Studio. 3 Ways To Remove Debug Banner In Flutterc49

12 Answers

935
votes

On your MaterialApp set debugShowCheckedModeBanner to false.

MaterialApp(
  debugShowCheckedModeBanner: false,
)

The debug banner will also automatically be removed on release build.

98
votes

OUTDATED

  • If you are using Android Studio, you can find the option in the Flutter Inspector tab --> More Actions.

Android Studio

  • Or if you're using Dart DevTools, you can find the same button in the top right corner as well.

Dart DevTools

35
votes

Well this is simple answer you want.

    MaterialApp(
     **debugShowCheckedModeBanner: false**
    )

    CupertinoApp(
     **debugShowCheckedModeBanner: false**
    )

But if you want to go deep with app (Want a release apk (which don't have debug banner) and if you are using android studio then go to

Run -> Flutter Run 'main.dart' in Relese mode

28
votes

If you are using IntelliJ IDEA, there is an option in the flutter inspector to disable it.

run the project

open the flutter inspector

hide slow banner

When you are in the Flutter Inspector, click or choose "More Actions."

Picture of the Flutter Inspector

When the menu appears, choose "Hide Debug Mode Banner"

Picture of Hide Debug Mode Banner

17
votes

There is also another way for removing the "debug" banner from the flutter app. Now after new release there is no "debugShowCheckedModeBanner: false," code line in main .dart file. So I think these methods are effective:

  1. If you are using VS Code, then install "Dart DevTools" from extensions. After installation, you can easily find "Dart DevTools" text icon at the bottom of the VS Code. When you click on that text icon, a link will be open in google chrome. From that link page, you can easily remove the banner by just tapping on the banner icon as shown in this screenshot.

NOTE:-- Dart DevTools is a dart language debugger extension in VS Code

  1. If Dart DevTools is already installed in your VS Code, then you can directly open the google chrome and open this URL = "127.0.0.1: ZZZZZ/?hide=debugger&port=XXXXX"

NOTE:-- In this link replace "XXXXX" by 5 digit port-id (on which your flutter app is running) which will vary whenever you use "flutter run" command and replace "ZZZZZ" by your global(unchangeable) 5 digit debugger-id

NOTE:-- these dart dev tools are only for "Google Chrome Browser"

13
votes

Here are 3 ways to do it

  • 1 : On your MaterialApp set debugShowCheckedModeBanner to false.

     MaterialApp(
       debugShowCheckedModeBanner: false
     )
    

    The slow banner will also automatically be removed on release build.

  • 2 : If you are using Android Studio, you can find the option in the Flutter Inspector tab --> More Actions.

enter image description here

  • 3 : There is also another way for removing the "debug" banner from the flutter app. Now after new release there is no "debugShowCheckedModeBanner: false," code line in main. dart file. So I think these methods are effective:

    --> If you are using VS Code, then install "Dart DevTools" from extensions. After installation, you can easily find "Dart DevTools" text icon at the bottom of VS Code. When you click on that text icon, a link will be open in google chrome. From that link page, you can easily remove the banner by just tapping on the banner icon as shown.

enter image description here

Credit to : How_to_remove_debug_banner_in_flutter_on_android_emulator

3
votes

To remove the flutter debug banner, there are several possibilities :

1- The first one is to use the debugShowCheckModeBanner property in your MaterialApp widget .

Code :

MaterialApp(
  debugShowCheckedModeBanner: false,
) 

And then do a hot reload.

2-The second possibility is to hide debug mode banner in Flutter Inspector if you use Android Studio or IntelliJ IDEA .

enter image description here

3- The third possibility is to use Dart DevTools .

2
votes

The debug banner appears only while in development and is automatically removed in the release build.

To hide this there is a need to set debugShowCheckedModeBanner to false

MaterialApp(
  debugShowCheckedModeBanner: false,
)

enter image description here

2
votes

The debug banner appears only while in development and is you can remove in the release build by set debugShowCheckedModeBanner: false inside your app StatelessWidget. if you are using Android Studio in your mai.dart set like this.

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: new MyHomePage(),
      routes: <String, WidgetBuilder>{
        //'/a': (BuildContext context) => MyPage(title: 'Page A')
      },
    );
  }
}
0
votes

You can give simply hide this by giving a boolean parameter-----> debugShowCheckedModeBanner: false,

void main() {
  Bloc.observer = SimpleBlocDelegate();

  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Prescription Writing Software',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        scaffoldBackgroundColor: Colors.white,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: SplashScreen(),
    );
  }
}
0
votes
MaterialApp(
  debugShowCheckedModeBanner: false,
)

This is the code for removing this banner. Debug banner is due to MaterialApp e.g. you can see this banner on all that pages that use
MaterialApp There should be at least one MaterialApp in your app on main root

0
votes

To hide the debug banner set debugShowCheckedModeBanner: false, in MaterialApp or ScaffoldApp

MaterialApp( debugShowCheckedModeBanner: false, )

or

ScaffoldApp(
             debugShowCheckedModeBanner: false,
        );