skip to Main Content

Riverpod stateNotifierProvider state is null – Flutter

Even after setting the state of Riverpod stateNotifierProvider, the state is null when used in the widget. I have this provider final imageNotifierProvider = StateNotifierProvider.autoDispose<ImageNotifier, FilePickerResult?>( (ref) => ImageNotifier()); class ImageNotifier extends StateNotifier<FilePickerResult?> { ImageNotifier() : super(null); void addImage(FilePickerResult result)…

VIEW QUESTION

Flutter Bloc Listen to stream and emit state with Cubit

How can I listen to stream and emit state with Cubit? With Bloc we can do something like this: on<VideoStreamPlayPauseEvent>( (event, emit) async { if (event.play) { await emit.forEach( videoStreamingRepo.videoDataStream, onData: (VideoData videoStreamData) => VideoStreamState( currentFrame: videoStreamData, isPlaying: true, ),…

VIEW QUESTION
Back To Top
Search