When you are running the flutter app for testing your app then you get the debug banner on the top right side. To remove it you have to set debugShowCheckedModeBanner: false. The banner will be automatically removed for the release build.
For MaterialApp set debugShowCheckedModeBanner to false.
MaterialApp(
debugShowCheckedModeBanner: false,
)
For CupertinoApp set debugShowCheckedModeBanner to false.
CupertinoApp(
debugShowCheckedModeBanner: false
)
Before adding debugShowCheckedModeBanner: false.

Full Code
import 'package:flutter/material.dart';
class MyApp extends StatefulWidget {
// This widget is the root of your application.
const MyApp({Key? key}) : super(key: key);
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State {
@override
Widget build(BuildContext context) {
return MaterialApp(
// Application name
title: 'My Flutter App',
debugShowCheckedModeBanner: false, // Remove debug banner
home: Scaffold(
appBar: AppBar(
// The title text which will be shown on the action bar
title: Text("My Flutter App"),
),
body: Center(
child: Text("Code the Best"),
),
),
);
}
}
void main() {
runApp(MyApp());
}
Output

Leave a Reply