Questions tagged [flutter-riverpod]
166 questions
0
votes
0 answers
Are FutureProvider new evaluations reported to its dependants?
Beckground: I noticed that in my app StreamProvider emits cause dependant FutureProvider to reevaluate its value, but providers dependent on this provider does not. I use Rivderpod 2.
I have a chain of dependent providers:
FutureProvider1 ->…

fpiechowski
- 517
- 1
- 7
- 21
0
votes
1 answer
Display more than a ListView in a flutter widget
I am working on my first flutter application and I have been facing a problem.
I have a riverpod StreamProvider giving back a stream of objects that I return in a ConsumerWidget:
return currentEntries.when(
data: (entries) {
return…

DeKekem
- 589
- 10
- 20
0
votes
0 answers
How to add Filter feature with Pagination in Flutter with Firebase, Riverpod
I optimized this code.
How can I combine the sentencesProvider and filterProvider to filter sentences as mostLiked and newest based on the option selected in a dropdown list using the PaginationNotifier and StateProvider classes in Riverpod?
My code…

Kai Tera
- 59
- 2
- 9
0
votes
0 answers
Flutter/Riverpod - StateNotifier - call state change before end of method - safe?
In my Flutter app I am using two providers to manage a list display...
a 'goalListFutureProvider ' Future provider that retrieves the list of entries to display
a 'goalCrudProvider' StateNotifier provider that handles add/edit/delete actions on…

user2868835
- 1,250
- 3
- 19
- 33
0
votes
0 answers
Is there a way to send data from FutureProvider to StateNotiferProvider in Flutter(Riverpod)?
I have a specific situation, so I need to put some data into a model with FutureProvider but I also need to have some additional fields that I want to change during the app, these fields need to be reactive. So this is my StateNotifier class:
class…

Vesko_dev
- 356
- 6
- 18
0
votes
1 answer
Appwrite Realtime subscription Flutter riverpod problem when unsubscribe to subscription
Appwrite realtime subscription dispose of (unsubscribe) issue with flutter_riverpod. By using this for a single document it is working. But the problem is when I am fetching multiple documents and subscribing to the doc When the page gets closed and…

monzim
- 526
- 2
- 4
- 13
0
votes
0 answers
How can TickerProvider vsync property be used inside ConsumerWidget/Stateless widget Riverpod | Flutter
The timer package I'm using made some breaking changes which are very helpful performance wise but this clashes with my design of ConsumerWidgets.
So I'm wondering if there is a way to get this working without changing everything.
This post gives a…

RobbB
- 1,214
- 11
- 39
0
votes
1 answer
Is there any way I can make the widget rebuild using this StateNotifierProvider (Flutter using riverpod)?
So I'm using this stateNotifierProvider in order to keep track of the selectedItem in this toggleButton, however even if the state of the notifier is in fact changed, it does not trigger the build function as it should... Can anyone help me with…

zatheg
- 1
- 2
0
votes
1 answer
What is the equivalent of StreamBuilder but with Riverpod?
I want to automatically update user data, such as username or bio, whenever it changes. I was doing this with a StreamBuilder, but I found Riverpod and it looks cool. However, I am not sure if it is capable of updating instantly. So, what is the…

Boatti
- 151
- 12
0
votes
1 answer
Delay in listening a value from provider in Riverpod
Minimal reproducible code:
StreamController _streamController = StreamController();
final provider1 = StreamProvider((ref) {
return _streamController.stream.map((value) {
print('listener1()');
return value;
});
});
final…

iDecode
- 22,623
- 19
- 99
- 186
0
votes
1 answer
Riverpod StateNotifier and a Stream
I've got a Stream being returned form a firebase service.
I'm using MVVM architecture and have a ProfileViewModel which is extended by a freezed state class:
class ProfileModel extends StateNotifier {
ProfileModel({
…

PowerMan2015
- 1,307
- 5
- 19
- 40
0
votes
0 answers
How do I add a single instance of an item from a List to a Cart List that show the quantity of that particular item using riverpod?
This image show List of Added items in the CartList, pressing the "--" or "+" does not reflect on the UI This second image shows the quantity of the same Item after I manually rebuild the UI**Say I have two Lists: **
List of Products from API List A…

snetwork2020
- 1
- 2
0
votes
0 answers
Riverpod Flutter StateError (Bad state: called ProviderSubscription.read on a subscription that was closed)
I'm trying to update my state management solution to Riverpod and I'm all over the place. I get this error when I try to pop a page from my nav stack. I have a provider to save a DocumentSnapshot from firestore so I can call certain fields from it.…

Hunter Books
- 372
- 2
- 11
0
votes
3 answers
How to solve "Do not use BuildContext across async gaps" in Riverpod's ConsumerWidget?
I get the warning "Do not use BuildContext across async gaps" when I use code like this:
await ref.read(testFutureProvider.notifier).doSomethingAsync();
Navigator.of(context).pop();
Normally it is possible to check the mounted property like…

maxmitz
- 258
- 1
- 4
- 17
0
votes
2 answers
Riverpod Provider to pass down FireStore document Id to other pages in app flow
I have an archaic solution for my problem, but it's quickly become cumbersome and not as robust. I want to switch to a riverpod provider and am studying how to do so, but I want to put this question out there at the same time. For simplicity, my app…

Hunter Books
- 372
- 2
- 11