如何删除 Flutter 调试横幅? [英] How can I remove the Flutter debug banner?

查看:25
本文介绍了如何删除 Flutter 调试横幅?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在 Flutter 中移除调试横幅?

How can I remove the debug banner in Flutter?

我正在使用 flutter screenshot,我希望屏幕截图没有横幅.现在确实有.

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

请注意,对于配置文件和发布模式,我收到 not supported for emulator 消息.

Note that I get not supported for emulator message for profile and release mode.

推荐答案

在您的 MaterialApp 上将 debugShowCheckedModeBanner 设置为 false.

On your MaterialApp set debugShowCheckedModeBanner to false.

MaterialApp(
  debugShowCheckedModeBanner: false,
)

debug 横幅也将在发布构建时自动删除.

The debug banner will also automatically be removed on release build.

这篇关于如何删除 Flutter 调试横幅?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆