Mastering Riverpod: State Management with MVVM Architecture in Flutter

Unlock the full potential of state management in Flutter with Riverpod, a modern and efficient framework that goes beyond Provider. This comprehensive codelab will teach you to handle asynchronous API calls, manage loading and error states with AsyncValue, and implement caching for a seamless user experience. Explore advanced state management techniques using Notifier and FutureProvider. With hands-on examples, you'll master combining data sources, managing global state with ProviderScope. Enhance your development workflow with unit testing and best practices, and effortlessly build scalable, high-performance Flutter applications.

Codelab Objectives

In this codelab, you’ll explore:

  • Introduction to Riverpod and why it is better than Provider for state management
  • Handle API requests using Riverpod to manage asynchronous network calls
  • Use AsyncValue to manage loading, error, and success states effectively
  • Implement caching with Riverpod for better UX and performance
  • Explore multiple ways to update specific widgets with optimized UI refresh strategies
  • Learn to combine multiple data sources into one using Riverpod
  • Use Notifier and FutureProvider for advanced state management
  • Manage global state with ProviderScope and use Riverpod’s dependency injection capabilities
  • Write and test Riverpod-based Flutter applications, including unit testing for providers
  • Follow best practices using Linter tools to ensure code quality and consistency

Codelab Content

Meet the instructor

Josteve Adekanbi

Content Author & Course Instructor

More courses by the instructor