How can I remove the Flutter debug banner?

FlutterDebuggingAndroid Emulator

Flutter Problem Overview


How can I remove the debug banner in Flutter?

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

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

Flutter Solutions


Solution 1 - Flutter

On your MaterialApp set debugShowCheckedModeBanner to false.

MaterialApp(
  debugShowCheckedModeBanner: false,
)

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

Solution 2 - Flutter

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

Solution 3 - Flutter

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.

Solution 4 - Flutter

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

Solution 5 - Flutter

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

Solution 6 - Flutter

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

Solution 7 - Flutter

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

Solution 8 - Flutter

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

Solution 9 - Flutter

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.

Solution 10 - Flutter

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

Solution 11 - Flutter

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.

Solution 12 - Flutter

In a Material app set debugShowCheckedModeBanner to false.

Solution 13 - Flutter

official example

MaterialApp(
  home: Scaffold(
    appBar: AppBar(
      title: const Text('Home'),
    ),
  ),
  debugShowCheckedModeBanner: false, //setup this property
)

for more information, view the official documentation.

Solution 14 - Flutter

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.

Solution 15 - Flutter

Go to main in the Lib folder find MaterialApp() and type debugShowCheckedModeBanner: false,

MaterialApp( debugShowCheckedModeBanner: false, )

Solution 16 - Flutter

Hope it will be helpful to some one

import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Your App Name',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      debugShowCheckedModeBanner: false,
    );
  }
}

Solution 17 - Flutter

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.

Solution 18 - Flutter

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

void main() => runApp(
      const MaterialApp(
                 debugShowCheckedModeBanner: false, 
                 home: Home()),
      );

Solution 19 - Flutter

You can use:

debugShowCheckedModeBanner: false, 

inside materialapp

Solution 20 - Flutter

use this

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      theme: AppTheme.appTheme,
      home: HomePage(),
    );
  }
}

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionTreeView Question on Stackoverflow
Solution 1 - FlutterRémi RousseletView Answer on Stackoverflow
Solution 2 - FluttertottomottoView Answer on Stackoverflow
Solution 3 - Fluttervivek yadavView Answer on Stackoverflow
Solution 4 - FlutterMamnarockView Answer on Stackoverflow
Solution 5 - FlutterSurendra KumarView Answer on Stackoverflow
Solution 6 - FlutterLoop AssemblyView Answer on Stackoverflow
Solution 7 - FlutterJaveed IshaqView Answer on Stackoverflow
Solution 8 - FlutterAwais RehmanView Answer on Stackoverflow
Solution 9 - FlutterMuhammad Umair SaqibView Answer on Stackoverflow
Solution 10 - FlutteralexbhandariView Answer on Stackoverflow
Solution 11 - FlutterKab AgoudaView Answer on Stackoverflow
Solution 12 - Flutterx86View Answer on Stackoverflow
Solution 13 - FlutterAymenView Answer on Stackoverflow
Solution 14 - Fluttershirsh shuklaView Answer on Stackoverflow
Solution 15 - FlutterKesselly KamaraView Answer on Stackoverflow
Solution 16 - FlutterAdie RTView Answer on Stackoverflow
Solution 17 - Fluttervs97View Answer on Stackoverflow
Solution 18 - FlutterSarthak RavalView Answer on Stackoverflow
Solution 19 - FlutterAbin vsView Answer on Stackoverflow
Solution 20 - FluttersumanthView Answer on Stackoverflow