Yellow lines under Text Widgets in Flutter?

Solution 1:

The problem is having a Scaffold or not. Scaffold is a helper for Material apps (AppBar, Drawer, that sort of stuff). But you're not forced to use Material.

What you're missing is an instance of Theme as a parent.

Why is that important to know? Because when you'll develop a Modal (using showDialog for example), you'll face the same problem. BUT Scaffold is an opaque fullscreen widget! And you obviously don't want that in your Modal.

There are many ways to introduce a Theme instance. In Material App, this is usually achieved by instantiating a Material Widget. And guess what? Scaffold creates one for you. But Dialog too!

Solution 2:

Add Material widget as root element.

@override
  Widget build(BuildContext context) {
    return Material(
        type: MaterialType.transparency,
        child: new Container(