Native Shopify Mobile App with 20 new features
Kickstart your hyperlocal marketplace in Corona pandemic with a starter guide
Android App Development
iOS App Development
Cross Platform App Development
Hire on-demand project developers and turn your idea into working reality.
Big thanks to Webkul and his team for helping get Opencart 126.96.36.199 release ready!
Owner and Founder. Opencart
In this blog we will learn about Widgets States in Flutter
Before going to know about widget states in Flutter let first know something about widget in flutter.
In flutter we use widget to make ui. To build any app in flutter we start it with widget.
It is the building block of flutter application.
We can compare widget with view in android, but the widget is more powerful then view.
Widgets are arranged in parent child tree like structure. The entire widget tree structure forms a layout or screen of app.
Flutter has a rich set off in-built widgets. Apart from this we can also create
own widgets according to need.
We can divide flutter widgets in two type.
1. Stateless Widgets
2. Stateful Widgets
The State is information that can read synchronously when the widget is build and might change during their lifetime of the widget.
A information of properties of a widget can be determine from a state.
We are all aware from immutable property means that remains unchanged.
Stateless widgets have immutable property.
They don’t change their state throughout the entire lifetime of widgets or Stateless widgets can’t change their state when app is running.
We can also say that widgets can’t be redraw while app is running.
For example- Icon and a text.
If a widget changes their behaviour througout their lifetime then it is stateful widgets.
Stateful widgets are dynamic widgets means that they are keep changes their state.
Staetful widgets can re-render or redraw when their state changes.
They can be updated during runtime ow while app is running based on user action or data change.
A stateful widget is implemented by two classes: a subclass of StatefulWidget and a subclass of State.
For Example: Checkbox, Radio Button
Let’s take below example in which button color gets changes and count value gets increased by one on every time button clicked.
Want to know more about states of widgets in flutter click here.
In this blog, we learn about states of widgets in flutter.
Hope ! this will help you in finding what you are looking for.
Thanks For Reading
Your email address will not be published. Required fields are marked*
Save my name email and website in this browser for the next time I comment.
Be the first to comment.
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.