Problem description

Recently, when I was writing the launch page of the Android project of the Flutter version, I found that there were two yellow underscores at the bottom of the text. At first, I felt confused, but after learning, I found that there were some problems with my code writing. Now I will make a note here. The Text component in the Flutter is Material style, which requires our root component to be Material style as well, otherwise there may be some problems with the UI presentation. The root component uses the Stack layout, which is not Material style. When the Stack is nested within the Text, there will be two yellow underscores underneath the Text.

The solution

There are two ways to solve this problem: 1. Change the Scaffold or Material component type of the root node

Scaffold(body: content,);

Material(child: content);
Copy the code

2. Change the decoration property under style to TextDecoration. None for the Text component that has problems

child: Text(
       "Technology connects the world.",
       style:TextStyle(color: Colors.white, decoration: TextDecoration.none),),
Copy the code

conclusion

Record the problems encountered in the development process and enjoy the joy brought by the technology