riverpod Questions

4

How can I clear the current state of my Riverpod providers manually in my Flutter app? The use case I have is when a user signs out of my app then signs up as a new/different user the previous user...
Indescribable asked 7/8, 2021 at 6:46

2

Solved

I have the following scanario: i`m using the riverpod state management across the application and everything works fine, but when I try to use in a screen that I reach using Navigator, the followin...
Diaconate asked 13/10, 2022 at 15:12

2

Solved

I've created List<String> favId = []; variable to store the item's ID with SharedPreferences, so the favorited items IDs don't get lost after I restart the application. And here is my SharedP...
Brunhild asked 21/4, 2021 at 10:30

4

Solved

I am developing a Flutter application with go_router and riverpod for navigation and state management respectively. The app has a widget which displays a live camera feed, and I'd like to "swi...
Piteous asked 29/10, 2022 at 18:13

4

Solved

Is there any way to retry a FutureProvider when the first attempt fails? The provider: final _dataProvider = FutureProvider((ref) => ref.watch(productRepositoryProvider).fetchProducts()); The c...
Gatto asked 6/4, 2021 at 11:56

2

Solved

I want to be able to create a StreamProvider.autoDispose and listen to it inside a StateNotifier. This way when the StateNotifierProvider.autoDispose is disposed of, the StreamProvider will also be...
Ecclesiology asked 26/7, 2022 at 9:24

4

Solved

In my sample project I implemented project with riverpod package and freezed. In the code below, I can get data from the server successfully, but when I try to use model.fromJson I get this error: ...
Shiri asked 15/7, 2021 at 6:9

2

Solved

Sometimes I think I'm getting the logic of providers and then I get stumped for hours trying to do something like below. I need to get a List of connection id's from a firestore collectionsstream. ...

3

Solved

I try to manage my states but I can't really do it. I would like to learn how to create a navigation bar at the bottom of the manage page with the riverpod package. I manage to manage the page on w...
Pediatrician asked 19/10, 2020 at 22:40

6

Solved

I'm stuck with a widget test and I could use some help to reproduce the behavior please run the code sample below import 'package:flutter/material.dart'; import 'package:hooks_riverpod/hooks_riverp...
Telegraphy asked 20/4, 2021 at 21:19

2

I'm following the example in https://carltonaikins.me/how-to-use-riverpod-2-generator-in-your-flutter-project and I now have ... @riverpod class HW extends _$HW { @override dynamic build(foo) =&g...
Redress asked 12/2, 2023 at 16:29

1

I want to test Riverpod StateNotifierProvider. I'm trying to follow a TDD approach for state notifier providers without implementing UI/Widgets. According to Riverpod documentation on testing, can ...
Driveway asked 27/8, 2021 at 19:42

3

How can I know the type of the parameter in the constructor to make riverpod works like get_it, so I don't have to pass ref.read(x) every time, so I just have to pass locator()? I'm just passing re...
Betti asked 1/1, 2023 at 11:15

2

Solved

I'm kinda confused as to what exactly the aim is with hooks_riverpod, I've used flutter_riverpod, and I've used flutter_hooks, but what is hooks_riverpod, on the pub.dev main page for hooks_riverpo...
Menhaden asked 5/7, 2023 at 14:0

0

I have the repository and I generate provider for this repository like this: @riverpod class Repository extends _$Repository { @override String? build() { return null; } Future<void> fe...
Vietcong asked 30/6, 2023 at 18:44

1

Solved

What is the difference between notifier provider and state notifier provider in flutter riverpod and when to use them. In the riverpod docs they ask to use notifier provider instead of state notifi...
Halfblooded asked 24/5, 2023 at 9:59

2

As the question implies, I am trying to create an AutoDisposeAsyncNotifierProviderFamily. I currently have this: final participantProvider = AsyncNotifierProvider.autoDispose.family< Participan...
Indetermination asked 26/3, 2023 at 19:31

1

I'm using riverpod with Freezed unions. I'm trying to merge/watch two FutureProviders that both return the same type into a StateNotifierProvider and use them to set state. I've noticed that becaus...
Mnemonics asked 22/8, 2021 at 18:14

2

Solved

I'm using Riverpod to listen to changes to a selected item from my store: I have a repository PlacesStore which has a Stream<PlaceDetails?> watchPlace(PlaceId placeId) method. I have wrapped...
Padding asked 14/3, 2023 at 16:38

2

Solved

This is my Notifier: class Counter extends Notifier<int> { final int initial; Counter(this.initial); @override int build() => initial; } I need to pass initial value to it, but I'm u...
Damaris asked 29/10, 2022 at 13:56

1

Solved

I'm using riverpod with flutter. On my main screen I have a FutureProvider which makes a call to the API server, and displays results on the page. At various points in the app, the user on differen...
Purposive asked 23/2, 2023 at 20:49

1

Solved

To preface, I am completely new to riverpod so my apologies if I get some terminology wrong. I have an edit feature that I'm implementing with riverpod that I'm migrating over to from flutter_blocs...
Horologium asked 23/12, 2022 at 16:28

2

Solved

Currently I am refreshing a FutureProvider that is responsible for fetching data from Firebase and displaying it in a simple ListView with liquid_pull_to_refresh package, which causes the list to d...
Torsibility asked 8/4, 2022 at 13:31

2

I looked at Riverpod's counter example and noticed it uses ConsumerWidget instead of ConsumerStatefulWidget. If ConsumerWidget can show state changes, is there any need to use ConsumerStatefulWidge...
Hargrave asked 5/12, 2022 at 10:39

1

Solved

I've been trying to find out what is the difference between watching a StateNotifierPovider object vs watching the notifier exposed by it. As we can see in the docs following section watching the n...
Gridley asked 16/11, 2022 at 19:22

© 2022 - 2025 — McMap. All rights reserved.