[英]Why text has underline with yellow color with big font size?
Screenshot of the code and it's result:代码截图和结果:
Hi, I have StatelessWidget
which has Container
returning in its build method and the Text
widget as a child widget.嗨,我有
StatelessWidget
,它在其构建方法中返回Container
,而Text
小部件作为子小部件。 But it's look and feel is not as expected.但它的外观和感觉并不像预期的那样。 Why is the
yellow
underline and how can I remove it?为什么是
yellow
下划线,如何去除?
I tried replacing the Container
with Stack
, Column
and Row
nothing change.我尝试用
Stack
、 Column
和Row
替换Container
没有任何变化。
Because of you havent wrap your Text
widget with a material widget.因为你还没有用材质小部件包装你的
Text
小部件。 You can wrap with a Scaffold
or with Material
widget with color property as you want.您可以根据需要使用
Scaffold
或具有颜色属性的Material
小部件进行包装。
Example:例子:
Scaffold(body: Center(child: Text("Here is the text")))
or:或者:
Material(color: Colors.white, child: Center(child: Text("Here is the text")))
Every screen should have a scaffold widget每个屏幕都应该有一个脚手架小部件
@override
Widget build(BuildContext context) {
return Scaffold(
body:Container(
child:Text("your text"),
),
);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.