Skip to content
Articles
Article

One network request, two models: BLoC states vs Riverpod's AsyncValue

by Stacklyn Labs dev.to

2 min read

Take one ordinary screen: fetch a user from an API and show it. Every app has to handle three outcomes: it worked it's still loading it failed BLoC and Riverpod both handle all three. The difference is who writes the plumbing. BLoC: you define every state With BLoC you model the states yourself and emit them. sealed class UserState {} class UserLoading extends UserState {} class UserLoaded extend…

Forum

Questions about this, or something to add?

Discuss on the forum

Topics Riverpod Bloc

Report this · Wrote this? Claim it

FlutterX is supported by