From the course: Flutter Essential Training: Build for Multiple Platforms
Unlock the full course today
Join today to access over 24,000 courses taught by industry experts.
Writing your first stateful widget - Flutter Tutorial
From the course: Flutter Essential Training: Build for Multiple Platforms
Writing your first stateful widget
- [Instructor] All this time, we were creating stateless widget to replace the static UI that we have been building till now. Like this chat and put all the chat bubbles, were all stateless widgets. But let's create a stateful widget and show you how it differs. Let's simply just recreate the default counter app. Now, do you remember the shortcut we learned earlier for creating stateless widget? Now for a stateful widget, we have the stful. Usually you get the suggestion once you write stf itself. Now we have to fill in the class name which in this case could be CounterStateful. Let's also import the material class. So now the errors are gone. So now here, you see two glasses being created. One is a subclass of StatefulWidget and another is a subclass of State. This State class contains the widget's mutable state and the widget's build method that you're already familiar with. This is where you define the UI, your…
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
-
-
-
-
-