Flutter Widgets - A brief guide
Tags: flutter, appdev, widgets, github
Published: 2020-11-06 05:32:58

In the eyes of mobile developers, Flutter is manna straight from heaven

Developers of an iOS app need not answer the question “When is it coming to Android?”

They already have questions haunting them like:

1.  When is the build ready to be shipped?
2.  How are we going to support this?
3.  Why is your shirt so dirty and you smell funny?

This was why Flutter came to the scene and unifying the iOS and Android codebases meant that developers now had more time to do other things, like sleep.

![](https://cdn-images-1.medium.com/max/960/0*fFMNfjRpZbOxw_sr)

<figcaption><a href="https://in.pinterest.com/pin/AfoR25I8KviONMo7v5xx65aPGjUPw8qOe3CmhTwdSZqryZk_0nBJHyk/?nic_v2=1a5cfUHVY">Image Credit</a></figcaption>

So now that we know Flutter is super useful, let us see what Flutter Widgets are all about.

## **What’s with Flutter and Widgets now?**

Flutter was developed by Google to make sure that there is not a steep learning curve for an iOS developer or an android developer when they want to go cross-platform.

All that Flutter asked was a blank screen.

![What’s with Flutter and Widgets now?](https://cdn-images-1.medium.com/max/960/0*dzeBn_jlZyOE6jQG)

There were widgets pre-built so that the developers don’t have to spend hours thinking about which codebase to copy to note pad and vice versa.

The central idea behind a widget is that once you build your UI using Widgets, you can then use these widgets to describe what view should look like, along with their configuration and state.

See how we can use a simple Flutter App to call the runapp() function with a widget:

## **The minimal Flutter App simply calls the runApp() function with a widget**

{% gist https://gist.github.com/roshanipatel5211/33b5aee69a02c200431fcea97cd9a763.js %}

The Widget Tree consists of two widgets, the Center widget and its child, the Text Widget.

Here are a few basic widgets listed for your ready reference:

1.  Text,
2.  Row,
3.  Column,
4.  Stack and
5.  Container.

There is a whole lot of free information available on the official Flutter widget page, which you can find [here](https://flutter.dev/docs/development/ui/widgets-intro#:~:text=Flutter%20widgets%20are%20built%20using,their%20current%20configuration%20and%20state.)​

The functionalities of a widget consist of anything ranging from a framework for your entire app (scaffold widget) to even animating an ink splash!

## **Creating your first Widget**

Every widget has its own unique purpose, just like how you were created on this earth to fulfill your own destiny. (Sorry got a bit philosophical there).

![](https://cdn-images-1.medium.com/max/960/0*Ur7rGYjRaWK8QHjL)

Okay Margaret Mead never said that, but that doesn’t mean you can stop on creating your first widget.

Imagine if you as a developer should code an “action button” for a shopping app. You can use the codebase from a Dart programming language and build the entire widget in less than a day.

For the full video tutorial, click [here](https://www.youtube.com/watch?v=W1pNjxmNHNQ).

And there you have it, folks!! Everything we know about Flutter Widgets.