Flutter development: remove the debug icon in the upper right corner of the app

At present, Flutter is used to develop a contact backup app, but the debug word in the upper right corner will block the icon, which is not very beautiful, so I want to remove it. The removal method is as follows:

Plus program default display pages debugShowCheckedModeBanner: false,can be.

import 'package:ContactApp/view/login.dart';
import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
    
    
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    
    
    return MaterialApp(
      //加入下面代码即可
      debugShowCheckedModeBanner: false,
      title: 'ContactApp',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: LoginPage(),
    );
  }
}

Before
Insert picture description here
removing: After removing:
Insert picture description here

Guess you like

Origin blog.csdn.net/peng2hui1314/article/details/105769223