<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300;1,400;1,500&display=swap" rel="stylesheet"/>

Flutter Debug Banner Removal: Best Practices and Techniques

By Mihir Pipermitwala · · 6 min read

⚡ TL;DR

Learn how to remove the debug banner in Flutter apps. Follow step-by-step techniques and best practices for a polished user experience.

Introduction

When developing Flutter applications, it is common to see a red “DEBUG” banner at the top right corner of the screen. While this banner is useful during the development phase, it is not desirable when sharing builds with testers or clients. Removing the debug banner is a small step that goes a long way toward a polished and professional user experience. In this tutorial, we will explore the best practices and techniques for removing the debug banner in Flutter applications.

First, an important fact that clears up a lot of confusion: the debug banner only ever appears in debug builds. Release and profile builds never show it, no matter what debugShowCheckedModeBanner is set to. So “removing the debug banner from production” is automatic — the flag below only affects what you (and your testers on flutter run builds) see during development.

Prerequisites

Before we proceed, ensure that you have the following prerequisites in place:

  • Flutter SDK installed on your machine.
  • A Flutter project set up and ready for development.

Step 1: Remove Debug Banner with debugShowCheckedModeBanner

To hide the banner in debug builds, set debugShowCheckedModeBanner to false on your MaterialApp (or CupertinoApp). Follow these steps:

  1. Open the lib/main.dart file in your Flutter project.
  2. Locate the MaterialApp widget that wraps your application.
  3. Add the debugShowCheckedModeBanner property to the MaterialApp widget and set it to false.

Here’s an example:

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

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

class MyApp extends StatelessWidget {
    const MyApp({super.key});

    
    Widget build(BuildContext context) {
        return MaterialApp(
            debugShowCheckedModeBanner: false, // Add this line
            home: const MyHomePage(),
        );
    }
}

class MyHomePage extends StatelessWidget {
    const MyHomePage({super.key});

    
    Widget build(BuildContext context) {
        return Scaffold(
            appBar: AppBar(title: const Text('Banner Demo')),
            body: const Center(child: Text('No banner here')),
        );
    }
}

Placement matters: debugShowCheckedModeBanner is a property of the MaterialApp widget itself (or WidgetsApp/CupertinoApp) — it does not belong on the Scaffold, the AppBar, or your home page. Setting it anywhere other than the app-level widget has no effect.

With debugShowCheckedModeBanner set to false, the banner will not be displayed during development, and it was never going to appear in your release build anyway.

Step 2: Toggling the Banner Conditionally (Debug vs Release)

If you want the banner on in development but off in builds you hand to testers, gate the flag with kDebugMode:

Copy
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';

class MyApp extends StatelessWidget {
    const MyApp({super.key});

    
    Widget build(BuildContext context) {
        return MaterialApp(
            // true only in debug builds; release and profile builds
            // never render the banner regardless of this value.
            debugShowCheckedModeBanner: kDebugMode,
            home: const MyHomePage(),
        );
    }
}

kDebugMode is a compile-time constant from package:flutter/foundation.dart, so this branch is resolved at build time — there is no runtime cost.

Bonus: What About Build Flavors?

A common misconception is that build flavors are configured in pubspec.yaml. They are not — Flutter has no flavor support in pubspec. Android flavors are defined in Gradle (android/app/build.gradle) and iOS schemes in Xcode, then selected with the --flavor flag. For example, on Android:

Copy
// android/app/build.gradle
android {
    flavorDimensions "env"
    productFlavors {
        dev {
            dimension "env"
            applicationIdSuffix ".dev"
        }
        prod {
            dimension "env"
        }
    }
}

Then run or build with:

Copy
flutter run --flavor dev
flutter build apk --flavor prod --release

Flavors control which backend, app ID, and assets are used — they do not affect the debug banner. A debug-mode build of any flavor shows the banner; a release build of any flavor never does. If your goal is a “clean” build for testers without shipping a full release, use flutter run --profile or a release build.

Conclusion

In this tutorial, we have learned how to remove the debug banner in Flutter applications. The key takeaways: set debugShowCheckedModeBanner: false on your MaterialApp to hide the banner during development, remember that release builds never show it in the first place, and keep build flavors in Gradle/Xcode — not pubspec.yaml. By following these best practices, you can ensure that your Flutter app provides a seamless and professional user experience.

Remember to thoroughly test your application after removing the debug banner to confirm that everything functions as expected. Happy coding!

References

FAQ

How do I remove the debug banner in Flutter?

Set debugShowCheckedModeBanner to false on your MaterialApp or CupertinoApp widget in lib/main.dart. This hides the red DEBUG ribbon in the top-right corner during development. Note that release and profile builds never show the banner regardless of this flag, so no change is needed for production — the setting only affects debug builds.

Does the Flutter debug banner appear in release builds?

No. The debug banner only ever renders in debug builds; release and profile builds never display it no matter what debugShowCheckedModeBanner is set to. That means “removing the debug banner from production” happens automatically, and the property only controls what you or testers running flutter debug builds see during development.

Where should debugShowCheckedModeBanner be placed in Flutter?

debugShowCheckedModeBanner is a property of the app-level widget — MaterialApp, CupertinoApp, or WidgetsApp — placed in your root widget, typically in main.dart. Setting it on the Scaffold, AppBar, or any inner page has no effect. If the banner persists after adding the flag, verify it is on the outermost app widget rather than a child.

Are Flutter build flavors configured in pubspec.yaml?

No. Flutter has no flavor support in pubspec.yaml. Android flavors are defined in android/app/build.gradle under productFlavors, and iOS flavors are configured as Xcode schemes, then selected with the —flavor flag when running or building. Flavors control backend, app ID, and assets — they do not affect the debug banner, which depends only on build mode.

Mihir Pipermitwala

Written by Mihir Pipermitwala

Senior Full Stack Consultant & Mobile Engineering Specialist building user-focused applications in healthcare with Flutter, Dart and React Native. I write about what I actually build and test — every tutorial here comes from real project work.

More about Mihir →
Scroll down to load comments...
Related Blogs
Go JSON v2: A Practical Migration Guide to encoding/json/v2

Go JSON v2: A Practical Migration Guide to encoding/json/v2

Migrate a Go REST API to encoding/json/v2 in 7 steps: struct tags, omitempty, unknown fields, error handling, and jsontext streaming, plus a v1 vs v2 comparison.

GOTUTORIALDEVELOPER TOOLS

November 12, 2026

Add an MCP Server to Your Flutter/Dart Tooling

Add an MCP Server to Your Flutter/Dart Tooling

Integrate a Model Context Protocol (MCP) server into your Flutter/Dart workflow. Step-by-step setup with Claude Code and real-world use cases.

AI TOOLSMCPFLUTTERDARTDEVELOPER TOOLS

October 06, 2026

Flutter On-Device LLM: Run Gemma & Llama Locally (2026)

Flutter On-Device LLM: Run Gemma & Llama Locally (2026)

Run on-device LLMs in Flutter using gemma_flutter and MediaPipe LLM Inference. No API keys, no internet — real-time AI on Android and iOS.

FLUTTERAI MLON DEVICE LLMGEMMALLAMA

September 24, 2026

How to Change minSdkVersion in Flutter: 2 Simple Approaches

How to Change minSdkVersion in Flutter: 2 Simple Approaches

Step-by-step guide to change the minSdkVersion in Flutter for Android. Learn how to configure local.properties or build.gradle for both new and old Flutter versions.

ANDROIDFLUTTERFLUTTER DEVELOPMENTMIN SDK VERSION

July 20, 2023

Related Tutorials
Essential Git Skills: How to Delete Remote Branches

Essential Git Skills: How to Delete Remote Branches

Keep your repository clean and organized. This guide walks you through how to delete both local and remote branches in Git, step by step.

BITBUCKETDELETE LOCAL BRANCHDELETE REMOTE BRANCHGITGIT BRANCH CLEANUP AUTOMATION

June 12, 2024

A Comprehensive Guide to Flutter Buttons: Choosing the Right One for Your App

A Comprehensive Guide to Flutter Buttons: Choosing the Right One for Your App

Complete guide to Flutter Button widgets. Learn how to use ElevatedButton, TextButton, OutlinedButton, IconButton, CupertinoButton, and FAB with examples.

CUPERTINO BUTTONELEVATED BUTTONFLOATING ACTION BUTTONFLUTTERFLUTTER BUTTON

April 17, 2024

Show an Offline Message for No Internet in Flutter

Show an Offline Message for No Internet in Flutter

You have to use the 'Connectivity Flutter Package' to achieve this feature on your App. This package helps to know whether your device is online or offline.

CONNECTIVITY PLUSDEPENDENCIESFLUTTERFLUTTER DEVELOPMENTFLUTTER PACKAGES

April 09, 2024

Mastering TabBar & TabBarView in Flutter: A Complete Guide

Mastering TabBar & TabBarView in Flutter: A Complete Guide

Implement TabBar and TabBarView in Flutter step by step — customize tab indicators, enable scrollable tabs, and change tabs programmatically.

CODINGDEFAULT TAB CONTROLLERFLUTTERLEARN TO CODETAB CONTROLLER

July 26, 2023

Related Recommended Services
Visual Studio Code for the Web

Visual Studio Code for the Web

Build with Visual Studio Code, anywhere, anytime, in your browser.

IDEVISUAL STUDIOVISUAL STUDIO CODEWEB
Renovate | Automated Dependency Updates

Renovate | Automated Dependency Updates

Renovate Bot keeps source code dependencies up-to-date using automated Pull Requests.

AUTOMATED DEPENDENCY UPDATESBUNDLERCOMPOSERGITHUBGO MODULES
Best XML Formatter and XML Beautifier

Best XML Formatter and XML Beautifier

Online XML Formatter will format xml data, helps to validate, and works as XML Converter. Save and Share XML.

XMLXML BEAUTIFIERXML CONVERTERXML FORMATXML FORMATTER
Kubecost | Kubernetes cost monitoring and management

Kubecost | Kubernetes cost monitoring and management

Kubecost started in early 2019 as an open-source tool to give developers visibility into Kubernetes spend. We maintain a deep commitment to building and supporting dedicated solutions for the open source community.

CLOUDKUBECOSTKUBERNETESOPEN SOURCESELF HOSTED
Related Recommended Stories
How GitHub reduced testing time for iOS apps with new runner features

How GitHub reduced testing time for iOS apps with new runner features

Learn how GitHub used macOS and Apple Silicon runners for GitHub Actions to build, test, and deploy our iOS app faster.

IOSGITHUBTESTINGRUNNER
5 ways to transform your workflow using GitHub Copilot and MCP

5 ways to transform your workflow using GitHub Copilot and MCP

Learn how to streamline your development workflow with five different MCP use cases.

AGENT MODECODING AGENTCOPILOTFIGMAGITHUB
One weird trick for powerful Git aliases

One weird trick for powerful Git aliases

Advanced Git Aliases

ALIASALIAS TEMPLATEATLASSIANBITBUCKETGIT
Awesome Python

Awesome Python

An opinionated list of awesome Python frameworks, libraries, software and resources

AWESOMEAWESOME PYTHONCOLLECTIONSGITHUBPYTHON
Related Recommended Tools
Find out what websites are built with - Wappalyzer

Find out what websites are built with - Wappalyzer

Find out the technology stack of any website. Create lists of websites and contacts by the technologies they use.

ADD ONSANALYTICSAPP STOREAPPLEBOOKING
Sourcetree | Free Git GUI for Mac and Windows

Sourcetree | Free Git GUI for Mac and Windows

A Git GUI that offers a visual representation of your repositories. Sourcetree is a free Git client for Windows and Mac.

GITGITHUBGITLABATLASSIANBITBUCKET
Related Recommended Videos