Flutter: How to remove the DEBUG banner on emulators

Last updated on January 16, 2022 A 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:

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'KindaCode.com',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const HomePage(),
    );
  }
}

// Other code

Further reading:

You can also take a tour around our Flutter topic page and Dart topic page to see the latest tutorials and examples.

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments

Related Articles