# 5.2 The Widgets

> Learn about widgets, the building blocks of every Flutter app, by building simple UIs with Text, Center and Container.

- URL: https://www.appwriters.dev/courses/master-flutter/ch05-flutter-basics/ls02-the-widgets
- Course: Master Flutter (https://www.appwriters.dev/courses/master-flutter)
- Chapter: 5. Basics of Flutter

---

In this lesson, we will learn about widgets, which are the fundamental building blocks of a Flutter app. We'll learn how to make a widget and use it in our app.

> **Tip:** Remember the classes and objects we practiced? Widgets are just that: classes, and we create objects from them to build the UI of our app.

## Projects

### 1. Center Text

Create a Flutter UI with text in the center of the screen. The text should be horizontally and vertically centered. 'Your Name' should be the text.

### 2. Container Text

Make a Flutter UI that shows text in a container. The container should be horizontally and vertically centered. The container should be 200 wide and 100 tall. The container should have a blue border with a width of two. The container should be red in color. All sides of the container should have 20 padding. 'Your Name' should be the text. The text size should be 24, the text color white, and the text weight bold. The text widget should be at the center.

### 3. Container with Decoration

Create a UI with the above widgets, then add a container to the body of a `Scaffold` and decorate it using `BoxDecoration` with color, border, shape, box shadow and more, to make an attractive box with the centered text `Good job`.

### 4. Container Widget

Write an article on Medium or Dev.to about the Container widget. Go in depth, and don't just copy and paste the documentation. Include many code examples along with screenshots and explain them. Some topics to cover:

- What is the Container widget?
- How to use the Container widget?
- When to use the Container widget?
- Examples of the Container widget

## Resources

While browsing resources, keep the project you're attempting to build in mind and concentrate on your requirements rather than everything in the resource. This will assist you in better understanding the concepts as well as focusing on the right things.

- [Flutter Widgets](https://docs.flutter.dev/ui)
- [Flutter Drawer](https://www.fluttercampus.com/tutorial/11/flutter-drawer/)
- [Basic widgets](https://docs.flutter.dev/ui/widgets/basics)
- [Flutter Basic Practice](https://medium.com/flutter-community/flutter-basic-widgets-349e24140453)
- [Container](https://api.flutter.dev/flutter/widgets/Container-class.html)
- [Text](https://api.flutter.dev/flutter/widgets/Text-class.html)
- [Center](https://api.flutter.dev/flutter/widgets/Center-class.html)
- [TextStyle](https://api.flutter.dev/flutter/painting/TextStyle-class.html)
- [Bottom Navigation Bar](https://api.flutter.dev/flutter/material/BottomNavigationBar-class.html)
- [Beginners guide to styling text](https://medium.com/flutter-community/beginners-guide-to-text-styling-in-flutter-3939085d6607)
