Flutter: How to remove the DEBUG banner on emulators

July 1, 2020 Goodman Loading... Post a comment

This article shows you how to get rid of the ugly (just my personal thought) debug banner located in the top right corners of iOS/Android emulators when you are working with Flutter.

The solution is quite simple. Everything you need to do is to go to the lib/main.dart file and set the debugShowCheckedModeBanner property of the MaterialApp class to false (It’s set to true by default).

To set debugShowCheckedModeBanner to false, add this line :

debugShowCheckedModeBanner: false,

Example:

// other code
class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      // Hide the Debug banner
      debugShowCheckedModeBanner: false,
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}
// other code
guest
0 Comments
Inline Feedbacks
View all comments

Related Articles

0
Would love your thoughts, please comment.x
()
x