3

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

Mangaldeep Pannu
  • 3,738
  • 2
  • 26
  • 45
IamVariable
  • 408
  • 6
  • 23
  • Manage to fix by myself after some searches, [You can see my updated code here](https://gist.github.com/MuthuHere/dbc7d959cf217e32d78beb0e3561c754) – IamVariable Jun 24 '19 at 03:49
  • Possible duplicate of [Yellow lines under Text Widgets in Flutter?](https://stackoverflow.com/questions/47114639/yellow-lines-under-text-widgets-in-flutter) –  Jun 24 '19 at 05:10

2 Answers2

2

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')),
        ),
      ),
    );
diegoveloper
  • 93,875
  • 20
  • 236
  • 194
0
    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,
                      ),
                    ),;
          ),
        );
Vithani Ravi
  • 1,807
  • 3
  • 13
  • 19