skip to Main Content

Why Riverpod provider goes into the loading state when there's already value? – Flutter

Minimum reproducible code: class FooPage extends ConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { final asyncValue = ref.watch(provider1); print('loading: ${asyncValue.isLoading}, value: ${asyncValue.valueOrNull}'); return Container(); } } final provider1 = StreamProvider<int>((ref) { final stream = ref.watch(provider2); return stream.maybeWhen( orElse: ()…

VIEW QUESTION
Back To Top
Search