Flutter Widgets
Flutter Widgets
Flutter Widgets
Flutter
Widgets
Flutter
Architecture of Flutter Application
Widgets
• The core concept of the Flutter framework is In Flutter,
Everything is a widget.
• Widgets are basically user interface components used
to create the user interface of the application.
• In Flutter, the application is itself a widget. The
application is the top- level widget and its UI is build
using one or more children (widgets), which again build
using its children widgets.
• This composability feature helps us to create a user
interface of any complexity. For example, the widget
hierarchy of the above example is as specified in the
following diagram:
Widget Hierarchy
My App
(top level/ Root)
Material App
MyhomePage
(Property:home)
Center
Scaffold
(property:body)
Text
AppBar
(Property:Appbar)
That’ s it
(property:child)
Widgets..
In Flutter, widgets can be grouped into multiple
categories based on their features, as listed below
• Platform specific widgets
• Layout widgets
• State maintenance widgets
• Platform independent / basic widgets
Layout widgets
To compose multiple widgets into a single widget, Flutter
provides large number of widgets with layout feature. For
example, the child widget can be centered using Center
widget.
Some of the popular layout widgets are as follows:
• Container: A rectangular box decorated using
BoxDecoration widgets with background, border and
shadow.
• Center: Center its child widget
• Row: Arrange its children in the horizontal direction.
• Column: Arrange its children in the vertical direction.
• Stack: Arrange one above the another.
StatefullWidget
Stateful can be thought of as redering through user input that becomes redering according to the
change of state. it can change its appearance in response to events triggered by user interactions or
when it receives data
Checkbox, Radio, Slider, InkWell, Form, and TextField are examples of stateful widgets
States….?
Change the
count ???
Statefull Widget
Mango
Vilat
Rs:256.00
Image rows
Layout widgets
• https://github.com/bizz84/layout-demo-flutter
Container
Container
Grid View
ListView
Stack
Stack
Hot Reload
Hot reload
• Hot reload feature quickly compile the newly added
code in our file and sent the code to Dart Virtual
Machine.
• After done updating the Code Dart Virtual Machine
update the app UI with widgets
• If you are using States in your application then Hot
Reload preservers the States so they will not update on
Hot Reload.
• Massively reduce the time from each development
cycle.
Hot reload
• Write Code
Hot Restart
Custom Font ..