How can I remove the debug banner in Flutter?

4 min read

To remove the debug banner in Flutter, you can add the following line of code in the main.dart file:

debugShowCheckedModeBanner: false,

This should be added as a parameter to the MaterialApp widget.

For example:

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'My App',
      debugShowCheckedModeBanner: false,
      home: MyHomePage(),
    );
  }
}

After adding this line of code, the debug banner should no longer be visible in your app.