The diagonal "DEBUG" banner in the top-right corner of a Flutter app during development is purely cosmetic — it never appears in a real release build regardless, but it's still worth knowing how to hide while taking screenshots or demoing a debug build to a client.
Removing it with a single property
MaterialApp(
debugShowCheckedModeBanner: false,
home: const HomeScreen(),
)
debugShowCheckedModeBanner: false on the top-level MaterialApp widget is the entire fix — it's a boolean flag specifically for this banner, unrelated to any other debug or release configuration.
The equivalent for CupertinoApp
CupertinoApp(
debugShowCheckedModeBanner: false,
home: const HomeScreen(),
)
Apps built with CupertinoApp (Flutter's iOS-styled root widget) instead of MaterialApp have the exact same property, since the banner itself isn't tied to Material Design specifically.
Why it only appears in debug mode in the first place
The banner is automatically excluded from both profile and release builds (flutter run --release or a genuine app store build) — it exists purely as a visual reminder that a currently running build is an unoptimized debug build, not a signal about the app's actual functionality or performance.
A common point of confusion: it's unrelated to actual debug logging
Setting debugShowCheckedModeBanner: false only removes the visual banner — it has no effect on whether the app is actually running in debug mode, on print() statement output, or on debugging tools like breakpoints and the Flutter DevTools inspector, all of which remain fully functional regardless of this one cosmetic setting.
Other debug-only visual indicators worth knowing about
// Highlighting widget rebuilds (for performance debugging)
debugRepaintRainbowEnabled = true;
// Showing layout construction guides
debugPaintSizeEnabled = true;
These are separate debug flags entirely, each toggled independently in code (typically in main()) rather than through a MaterialApp property — worth knowing they exist separately from the debug banner, since disabling one has no effect on the others.