Questions tagged [riverpod]
For questions relating to the "riverpod" package for the Flutter framework.
riverpod
1,435
questions
0
votes
1
answer
24
views
Riverpod - share data between providers
What's the canonical way to share data between two providers created with riverpod? In addition those two providers might only be very loosely connected logically speaking...
Let's assume we've got an ...
0
votes
1
answer
25
views
Why the state is not persistent over screens of stateNotifierProvider of riverpod in flutter?
I am trying to persist the state of a form globally but what i am getting is the default value when i am navigating to another screen in the same project?
i have found similar post here [https://...
0
votes
0
answers
19
views
Correct flow for retrieving access token of OIDC provider using Firebase Auth in Flutter
I'm using Firebase Auth in my app and I'm signing in using an OAuthProvider like this:
final credential = await FirebaseAuth.instance.signInWithProvider(
OAuthProvider('oidc.my-oidc-provider')
.....
1
vote
1
answer
32
views
Asyncvalue guard Method inside build Riverpod
below is a code snippet from a tutorial I am trying to learn.
appreciate if you could tell me why we are not using protection : asyncvalue.guard inside build() but later used when calling the same ...
-1
votes
0
answers
49
views
How to force a Provider to notify on change?
I have a Provider that returns a Map. the map reference is constant, however the content of the map changes.
When I watch my provider in a ConsumerWidget, my build method does not get trigger. Even ...
0
votes
0
answers
22
views
Is there a pattern for signals with arguments?
With the recent blow up of signals in almost every major js ui framework, there is one part of it I don't fully understand:
Say for example one wants to create signals for cached Rest queries.
My ...
0
votes
1
answer
31
views
How can I watch a change in the list size with Riverpod on a Flutter app?
I have a list of todo elements managed by:
@Riverpod(keepAlive: true)
class TodosNotifier extends _$TodosNotifier {
@override
List<Todo> build() {
return [.....some elements here.....];
...
0
votes
0
answers
27
views
Flutter go_router redirects to / on state change when it should not redirect at all
I have this router:
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:go_router/go_router.dart';
import 'package:horizon/providers/user....
0
votes
1
answer
42
views
How to disable skipLoadingOnRefresh with flutter riverpod using switch expression
Lets say i have this simple future riverpod which is
@riverpod
Future<double> balance(BalanceRef ref) async {
await Future.delayed(const Duration(seconds: 5));
return 100;
}
and inside ...
-1
votes
1
answer
50
views
Type cast error when using Ref in a class as a parameter with ConsumerStatefulWidget in Flutter Riverpod
I am using Flutter with Riverpod and have a utility class MapServices that relies on Ref to access state providers. I'm trying to use this class within a ConsumerStatefulWidget, but I'm encountering a ...
0
votes
2
answers
42
views
Ref.read riverpod provider in a button onPressed getting disposed as soon it is initiated
When trying to read a collection from cloud_firestore, I'm using riverpod provider.
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';...
0
votes
0
answers
55
views
GoRouter rebuilds on redirect with Firebase and Riverpod
I am working on a mobile application using Riverpod with code generation without hooks as state management and Firebase for authentication. Innitially i was using the defalt navigation but after ...
0
votes
1
answer
59
views
How to Display Only One Edit Icon for Selected Container in Flutter?
I'm trying to implement a feature where an edit icon appears only for the container the user is hovering over. Currently, when I hover over one container, edit icons appear for all four containers. ...
0
votes
1
answer
62
views
Best way to pass data from form to a function in Flutter?
This is the program I have running:
I have an app that is a single page.
The page's widgets are defined in separate files.
I have data that comes from the serial port and data that is entered in a ...
0
votes
0
answers
19
views
Flutter RIverpod; How to update UI from Search results
Iam using a defaultProvider = ref.watch(defaultProvider) which is a FutureProvider to fetch data from an api source and using the result to populate aListView.Builder using
ref.watch(countryProvider)....