How to remove the Flutter debug banner?

前端 未结 12 641
死守一世寂寞
死守一世寂寞 2020-12-07 11:13

How to remove the debug banner in Flutter?

I am using a flutter screenshot and I would like the screenshot not to have a banner. Now it does have.

12条回答
  •  难免孤独
    2020-12-07 11:35

    its app.dart class property,

    Displays a Banner saying "DEBUG" when running in checked mode. MaterialApp builds one of these by default.

    for disable this banner in debug mode also, you can set bool false.

    return MaterialApp(
      theme:....
      debugShowCheckedModeBanner: false,
      home: SplashScreen(),
    );
    

    In release mode this has no effect.

提交回复
热议问题