Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why text has underline with yellow color with big font size?

Screenshot of the code and it's result:

enter image description here

Hi, I have StatelessWidget which has Container returning in its build method and the Text widget as a child widget. But it's look and feel is not as expected. Why is the yellow underline and how can I remove it?

I tried replacing the Container with Stack, Column and Row nothing change.

like image 448
Trần Thanh Bình Avatar asked Sep 02 '25 14:09

Trần Thanh Bình


1 Answers

Because of you havent wrap your Text widget with a material widget. You can wrap with a Scaffold or with Material widget with color property as you want.

Example:

Scaffold(body: Center(child: Text("Here is the text")))

or:

Material(color: Colors.white, child: Center(child: Text("Here is the text")))
like image 100
Blasanka Avatar answered Sep 05 '25 16:09

Blasanka