Issue I having setting up local notifications in my flutter app using flutter_local_notifications. In the example provided on the page the configurations are done before runApp. But I am defining the local notification plugin as riverpod provider to have easier
Continue readingTag: riverpod
How do you update the state of a riverpod Future provider via a method
Issue I have a futureProvider that watching the stream of AuthStateChanges and adjusts its state accordingly, but I also want to be able to manually control the state but I can use a method because its telling me the type
Continue readingWhy does Riverpod generator not generate an AsyncNotifier in this case?
Issue I want to generate an AsyncNotifier that takes one argument on build: @riverpod class ListController extends _$ListController { late ServiceOne _serviceOne; late ServiceTwo _serviceTwo; @override Future<List<ItemModel>> build(ListModel List) { _serviceOne = ref.read(serviceOneServiceProvider); _serviceTwo = ref.read(serviceTwoServiceProvider); return _fetchListItems(list); } ///
Continue readingRiverpod state management – update UI, when request gets called
Issue I have a MainPage, where I have a ListView of my rooms. The ListView uses the response from my getUserRooms service. Everything works fine; I can’t understand why The ListView doesn’t update when my createRoom request gets called, which
Continue readingTrying to build a ListView using Riverpod as state watcher
Issue My goal is to have a ListView.builder, which updates, whenever the state changes. My state depends on a HTTP request. I manage to make my request successfully, I get a response and make it a List. For some reason,
Continue readingFlutter & riverpod: How to use ".when" with a provider
Issue I’m trying to use ".when" method on a provider I created but I got "The method when isn’t defined for the type Future" I would like to use a service class for all my bluetooth method. part ‘bluetooth_manager.g.dart’; @riverpod
Continue readingHow to filter elements in a list inside a stream in Dart/Flutter?
Issue I want to filter out certain elements inside a stream that emits a list of elements. For example a simple model (Item) that is the element inside the List: class Item { int id; String title; bool isDone; }
Continue readingHow can I access Ref when extending another widget
Issue I am trying to make a custom form field in Flutter for selecting one of many Locations retrieved from a backend API. I am using riverpod to store these Location objects across the application. Since I can’t extend ConsumerState,
Continue readingRiverpod state is null after returning in the build of the notifier
Issue I have this notifier: class AsyncPlayerNotifier extends AsyncNotifier<PlayerData> { @override Future<PlayerData> build() async { return const PlayerData( PlayerRequestState: AsyncAction.initial(), player: null); } Future<void> setPlayer(Player player) async { state = const AsyncValue.loading(); // verify player // … state = AsyncValue<PlayernData>.data(state.value!.copyWith(
Continue readingHow do I make the first Card in a ListView.builder already clicked when widget is displayed
Issue I have a ListView.builder that shows Tasks Fetched from Firebase and allows the users to select one of them, now I don’t want the widget to be in a state where not one task is clicked (this widget is
Continue reading