
image.png
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner:false, // 加入这行代码,即可关闭'DEBUG'字样
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.orange,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: MyHomePage(title: 'xxx'),
);
}
}
本文介绍如何通过简单修改Flutter项目的代码来移除运行时显示的'DEBUG'标志。此改动涉及将debugShowCheckedModeBanner设置为false。

被折叠的 条评论
为什么被折叠?



