Your First Flutter App: An App From Scratch, Episode 12: Build an Interface | raywenderlich.com

Now that you have an idea of how widgets function, we’ll build our game interface using several of the Flutter’s provided widgets.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/27732840-your-first-flutter-app-an-app-from-scratch/lessons/12

Dear Sir,
I am getting these error. const Text() is not working. And nothing is appearing on my emulator
image

Hey there, sorry you are running into issues, but that’s where all the true learning is done :slight_smile:

You’re getting an error because you’ve declared the Widget list as a constant, and then you’ve put a TextButton in it which is using a closure in onTap. This means, the TextButton isn’t being used as a constant.

To fix this, remove the const from the widget list. So it should resemble the following:

children: <Widget>[
    const Text(...),
    TextButon(...)
]

I hope that helps!

Thank you so much, sir. Can you please help me with the print() as well?
image

The blue squiggle indicates a warning. In this case, the compiler is warning you that print statements shouldn’t be used in production code. That is, you would never want to submit an app with print statements to the app store. Being this is just a tutorial, you can disregard that warning.

Thank you so much for helping me out. :slight_smile:

1 Like