Skip to main content ppwriters

#30DaysMasterFlutter

Day 23

Understanding State Management

State is the data that can change. Modern apps are dynamic and interactive. They respond to user input and change their appearance accordingly. For example, when you tap on a button, the button changes its color to indicate that it has been tapped. This is an example of state. The button’s color changes when it is tapped. However large applications have complex state that can change in many ways. Managing this state is a challenge. This is where state management comes in.

Project - Authentication State

Using Simple StatefulWidget, update the quotes app that you have been building so that it keeps track of user’s authentication state and provides option to logout.

  • If the user is authenticated, show quotes page and logout icon on appbar
  • if the user is not authenticated, show login page

By the end of this day, you will learn what state management is, what different approaches to state management are, and how to use them in your Flutter apps.

Tips

  • State management is a way to manage state in your app. It is not a specific package or plugin.
  • State management is a complex topic. It is important to understand the basics before diving into advanced topics.
  • There are many different approaches to state management. Each approach has its own pros and cons. There is no one size fits all solution.
  • Depending on the size, type, and complexity of your app, you may need to use different approaches to state management.
  • Some popular state management approaches are Inherited widget, Provider, BLoC, Riverpod, MobX, Redux

Resources

Enjoying? Tell your friends.

#30DaysMasterFlutter

Learn the basics of Flutter and Dart in 30 days! We provide a roadmap, resources, and project ideas to help you along your journey.

back to 30 Days to Master Flutter

Join our community on Discord to connect with fellow learners, share your progress, and get help with any questions you may have throughout the #30DaysMasterFlutter challenge. Join now and get started on your journey to mastering Dart and Flutter!

join now