823

I'm using flutter screenshot and I expected the screenshot to not have a banner, but it has.

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

My Car
4,6507 gold badges26 silver badges78 bronze badges
asked Feb 20, 2018 at 20:46
0

17 Answers 17

1578
+50

On your MaterialApp set debugShowCheckedModeBanner to false.

MaterialApp(
 debugShowCheckedModeBanner: false,
)

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

Ramesh R
7,0874 gold badges27 silver badges40 bronze badges
answered Feb 20, 2018 at 20:48
Sign up to request clarification or add additional context in comments.

9 Comments

Usage: return new MaterialApp( home: new LoginPage(), debugShowCheckedModeBanner: false, theme: new ThemeData( primarySwatch: Colors.green, ));
do i need to use debugShowCheckedModeBanner: false on each class means activity ?
The flutter tool's built-in screenshot command also knows how to automatically remove the "debug" banner while taking a screenshot if that's helpful.
@EricSeidel Not by default it doesn't (Flutter 1.16.4-pre.18 • channel master • github.com/flutter/flutter.git Framework • revision c8efcb632b (6 weeks ago) • 2020年03月27日 22:31:01 -0700 Engine • revision 3ee9e3d378) Is there a trick to enable this?
Is there any way to show it in release build? I am building a release versions but for dev/production environments
|
132

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

Peter Mortensen
31.4k22 gold badges110 silver badges134 bronze badges
answered May 13, 2019 at 10:12

1 Comment

Disappeared on the DevTools View, but I have found it through AndroidStudio
85

Well, this is the simple answer you want.

MaterialApp(
 debugShowCheckedModeBanner: false
)
CupertinoApp(
 debugShowCheckedModeBanner: false
)

But if you want to go deep with the app (want a release APK file (which doesn't have a debug banner) and if you are using Android Studio then go to RunFlutterRun 'main.dart' in Release mode.

Peter Mortensen
31.4k22 gold badges110 silver badges134 bronze badges
answered Jul 14, 2019 at 19:52

Comments

54

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 the 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

Peter Mortensen
31.4k22 gold badges110 silver badges134 bronze badges
answered Mar 9, 2018 at 15:23

1 Comment

This menu and related item doesn't exist in idea 2020.3 and flutter 55.0.3
46

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

answered Dec 6, 2020 at 9:15

Comments

46

Three ways to remove flutter debug banner:-

1. In the MaterialApp/ScaffoldApp

Snippet

MaterialApp(
 debugShowCheckedModeBanner: false,
)

OR

ScaffoldApp(
 debugShowCheckedModeBanner: false,
 );

2.By making release version of your app

For running release version of your app, use this command

flutter run --release

Or if using real devices rather than emulators or simulators. make a build version of the app.

flutter build apk

3.BY using dart dev tool to remove debug banner

IN vs code type ctr+shift+pin windows and for mac cmd+shift+p and use this command to open dart dev tool

Dart: Open DevTools

enter image description here

answered Dec 18, 2021 at 7:10

1 Comment

Ctrl-Shift-P stopped my phone debugging working, and didn't bring up the Dart Dev tools. Have restarted Android Studio and still not working, will try reboot now, but try at your own risk!
34

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

  1. If you are using Visual Studio Code, then install `"Dart DevTools" from extensions. After installation, you can easily find the "Dart DevTools" text icon at the bottom of Visual Studio Code. When you click on that text icon, a link will be opened 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 Visual Studio Code

  1. If Dart DevTools is already installed in your Visual Studio Code, then you can directly open Google Chrome and open the 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 the flutter run command and replace "ZZZZZ" by your global (unchangeable) 5 digit debugger-id

Note: These Dart developer tools are only for the Google Chrome browser

Peter Mortensen
31.4k22 gold badges110 silver badges134 bronze badges
answered Apr 2, 2019 at 19:29

Comments

25

On your MaterialApp set debugShowCheckedModeBanner to false.

 MaterialApp(
 debugShowCheckedModeBanner: false,
 )

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

If you are using emulator or real device and you want to check it on release mode then =>

 flutter run release --apk 

run this command on terminal Android Studio / Vs Code

answered Sep 30, 2021 at 7:43

Comments

24

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.

Peter Mortensen
31.4k22 gold badges110 silver badges134 bronze badges
answered Dec 10, 2020 at 15:03

1 Comment

This menu and related item doesn't exist in idea 2020.3 and flutter 55.0.3
20

All other answers are great for Android Studio, but if using Visual Studio Code there is a command you can use to toggle this easily. Open the command palette (Mac: Cmd + Shift + P or Windows: Ctrl + Shift + P). Then type toggle debug-mode banner as shown below:

Enter image description here

Peter Mortensen
31.4k22 gold badges110 silver badges134 bronze badges
answered Aug 4, 2021 at 0:55

Comments

19

Use:

MaterialApp(
 debugShowCheckedModeBanner: false,
)

This is the code for removing this banner. The 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.

Peter Mortensen
31.4k22 gold badges110 silver badges134 bronze badges
answered Apr 7, 2021 at 5:25

Comments

11

It's the app.dart class property.

It displays a banner, saying "DEBUG" when running in checked mode. MaterialApp builds one of these by default.

For disabling this banner in debug mode also, you can set a Boolean false.

return MaterialApp(
 theme:....
 debugShowCheckedModeBanner: false,
 home: SplashScreen(),
);

In release mode this has no effect.

Peter Mortensen
31.4k22 gold badges110 silver badges134 bronze badges
answered Dec 4, 2020 at 10:22

Comments

10

If you are still in debug mode, you can switch to release mode and the banner will be gone.

release

enter image description here

You can also open the same Run/Debug Configurations window via shortcuts:

ALT+SHIFT+F10, then Press 0 and Press ALT+a.

Now enter --release.

answered May 2, 2022 at 17:01

Comments

8

If you use Scaffold in Return Section so add on Top MaterialApp and Restart

void main() => runApp(
 const MaterialApp(
 debugShowCheckedModeBanner: false, 
 home: Home()),
 );
answered May 6, 2022 at 8:09

1 Comment

This works well
3

This is the simplest way.

For : MaterialApp( debugShowCheckedModeBanner: false )

For : CupertinoApp( debugShowCheckedModeBanner: false )

If you are logically handle another flutter components them you use a bool variable & handle it. For Example bool isDebug === false ;

if(isDebug == true) { debugShowCheckedModeBanner: true }

else { debugShowCheckedModeBanner: false }

Thanks & Enjoy)):

answered Sep 12, 2022 at 4:35

1 Comment

Though we thank you for your answer, it would be better if it provided additional value on top of the other answers. In this case, your answer does not provide additional value, since another user already posted that solution. If a previous answer was helpful to you, you should vote it up once you have enough reputation
3

If you are using the Material library

MaterialApp(
 debugShowCheckedModeBanner: false
)

If you are using the GetX library

GetMaterialApp(
 debugShowCheckedModeBanner: false
)

If you are using the Cupertino library

CupertinoApp(
 debugShowCheckedModeBanner: false
)
answered Jun 24, 2024 at 20:10

1 Comment

This works for me
3

add debugShowCheckedModeBanner: false, into the materialApp Widget.

 MaterialApp(
 debugShowCheckedModeBanner: false
)
answered Dec 17, 2024 at 6:36

1 Comment

Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.