From the course: Flutter Essential Training: Build for Multiple Platforms
What is state? - Flutter Tutorial
From the course: Flutter Essential Training: Build for Multiple Platforms
What is state?
- [Instructor] All this while, we have been building a static UI that does not change over time. For example, notice the value of the text in the login page here, or the image. They will not really change while the user is using the app. Now, do you remember the default counter app? Let's run that again. So here on tapping of the floating action button, the value of the counter keeps incrementing. So this is not an example of static UI because some information on the screen keeps changing. Therefore, this is an example of a dynamic UI. Now, if I ask you what is the visible information that you see on the screen? What would be your answer? Now you may wonder what is a static information and dynamic information? Well, a screen with just an image, which never changes throughout the application life cycle is static information, or even whatever we build 'til now all holds static information. Or a screen like this counter app, which changes throughout the application life cycle because of user interaction, or maybe an app that shows time. The visible information keeps changing with time or user interaction, or because of some business logic. This visible information is called the state of the app. This value count that you see here, this is the local or UI state of the counter app. Or when there are user preferences shared throughout the app, like dark mode or light mode preferences, that is more of a global state of the app. Also called app state. Basically state is every visible information that exists in the memory and is mutated, or it changes because of an external interaction combined with business logic execution.
Contents
-
-
-
-
-
-
What is state?1m 55s
-
(Locked)
Writing your first stateful widget7m 17s
-
(Locked)
Widget variables vs. state variables3m 26s
-
(Locked)
When to use stateless or stateful?1m 51s
-
(Locked)
Lifecycle of a stateful widget3m 44s
-
(Locked)
Stateful hot reload3m 22s
-
(Locked)
Learning about buttons6m 50s
-
(Locked)
Taps and gesture detection3m 47s
-
(Locked)
Getting inputs from the user7m 40s
-
(Locked)
Validating user inputs7m 55s
-
(Locked)
Creating multiline text fields6m 46s
-
(Locked)
Navigating from one screen to another5m 41s
-
(Locked)
Passing data with navigation2m 7s
-
(Locked)
Navigating via named routes4m 8s
-
(Locked)
Replacing routes using Navigator5m 16s
-
-
-
-
-