How to remove DEBUG banner from the Emulator in Flutter Apps

How to remove DEBUG banner from the Emulator in Flutter Apps

During the development Flutter automatically adds DEBUG banner to the applications. Sometimes we may want to remove this banner for any reason such as taking a screenshot without the DEBUG banner.

To remove the DEBUG banner from the application, go to main.dart and add the following option to the MaterialApp (or CupertinoApp for iOS apps ) widget

debugShowCheckedModeBanner: false,

example:

...
return MaterialApp(
      title: 'Flutter Demo',
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        // This is the theme of your application.
        //
        // Try running your application with "flutter run". You'll see the
        // application has a blue toolbar. Then, without quitting the app, try
        // changing the primarySwatch below to Colors.green and then invoke
        // "hot reload" (press "r" in the console where you ran "flutter run",
        // or simply save your changes to "hot reload" in a Flutter IDE).
        // Notice that the counter didn't reset back to zero; the application
        // is not restarted.
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage() ,
    );
...

Flutter automatically removes the DEBUG banner when we build the application for production.

Leave A Comment

Your email address will not be published. Required fields are marked *