what is the route cause of Yellow underline for the Text in Flutter

Viewed 3728

I am new to Flutter. I am preparing Login page. In the same, I am using a Text widget. For that i am getting Yellow double underline.

I am trying to fix with Scaffold as route layout

return new Scaffold(
  body: Container(
    decoration: BoxDecoration(
      image: DecorationImage(
        image: AssetImage("assets/images/bg.png"),
        fit: BoxFit.cover,
      ),
    ),
    child: MaterialApp(
      home: SingleChildScrollView(
        child:Text('Test')
      ),
    ),
  ),
);

Here is my Screenshot

2 Answers

Just change the parent of your Scaffold , MaterialApp should be the parent of all of your widgets tree.

  return MaterialApp(
      home: Scaffold(
        body: Container(
          decoration: BoxDecoration(
            image: DecorationImage(
              image: AssetImage("assets/images/bg.png"),
              fit: BoxFit.cover,
            ),
          ),
          child: SingleChildScrollView(child: Text('Test')),
        ),
      ),
    );
    Remove all other only use text   

 return new Scaffold(
          body: Container(
            decoration: BoxDecoration(
              image: DecorationImage(
                image: AssetImage("assets/images/bg.png"),
                fit: BoxFit.cover,
              ),
            ),
            child: new Text(
                     "your text",
                      maxLines: 3,
                      style: TextStyle(
                        fontWeight: FontWeight.bold,
                        fontSize: 18,
                      ),
                    ),;
          ),
        );
Related