[英]Unable to remove visual debugging for Flutter in VSCode
我正在寻找一种禁用 Flutter 可视化调试的方法:(在 Chrome 模拟器上使用 VSCode、Flutter Web)
正如您所看到的,尽管我有一个非常简单的主题,没有任何基础或颜色,但它添加了一堆不需要的东西。 我已经在代码和选项中禁用了 debugPaint,但这仍然存在。
以下是在 MaterialApp 级别导入的主题:
theme: ThemeData(
primarySwatch: Colors.blue,
)
以及屏幕截图中显示的卡片本身:
@override
Widget build(BuildContext context) {
print('Adding article: ' + article.title);
return Column(children: [
Container(
height: 30,
width: 30,
decoration: BoxDecoration(
border: Border.all(width: 3.0),
),
child: Text(article.title),
),
Text(
article.title,
style: TextStyle(fontSize: 21, fontWeight: FontWeight.bold),
),
Text(
article.description,
style: TextStyle(fontSize: 16, color: Colors.grey[500]),
),
Text(
article.publishDate,
style: TextStyle(fontSize: 14, color: Colors.grey[300]),
)
]);
}
}
附加说明:将 debugLines 设置为 true 会添加更多元素:
小部件树直接从 Material App 转到 SingleChildScrollView。 它缺少 Scaffold 小部件(如 flutter 文档中所示):
实现了基本的 Material Design 视觉布局结构
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.