Questions tagged [flutter-riverpod]

166 questions
1
vote
0 answers

Flutter UncontrolledProviderScope error with Riverpod

Here i have a simple animated dialog which with that i can show one screen into that. this screen into animated dialog sending request on appearing into dialog and can be receive data from server without any problem. but when i drag this dialog on…
DolDurma
  • 15,753
  • 51
  • 198
  • 377
1
vote
0 answers

Riverpod ovveriden provider (throw unimplemented error)

So I am using a riverpod with ChangeNotifier, GoRouter and Hive So this is my RouteService class with parameter of HiveBox; class RouteService extends ChangeNotifier { late final Box box; bool _initialized = false; bool _loginState = false; …
1
vote
1 answer

Combining River pod providers

I'm trying to create a simple riverpod counter app by combining two providers where if the count of one provider changes, the result gets multiplied by the value of the other provider, but I'm getting a compile time error when approaching it the…
1
vote
0 answers

Flutter riverpod Unhandled Exception: Looking up a deactivated widget's ancestor is unsafe error

I am getting this error in my code -> Unhandled Exception: Looking up a deactivated widget's ancestor is unsafe. I am using riverpod in my flutter project and doing some api call and the data which i am getting from api adding it to respective…
1
vote
0 answers

how to override a riverpod provider while navigating to another page/screen in flutter?

I have a provider which defaults to Throwing UnimplemedtedError.. I wanted to override it and give a value while navigating to another screen because I need the value for the next screen. see below my implementation void main() async { …
john
  • 1,438
  • 8
  • 18
1
vote
3 answers

How can I show CircularProgressIndicator() on when method in AsyncData?

I want to show CircularProgressIndicator() during loading process with FutureProvider and when() method as following code. print("It works");//here is worked as expected but, CircularProgressIndicator() has never been shown at loading,//here. Is my…
SugiuraY
  • 311
  • 1
  • 9
1
vote
2 answers

Provider to Riverpod

So I am using the Flutter game template, which I found this: ProxyProvider2, AudioController>( // Ensures that the AudioController is created on startup, //…
1
vote
1 answer

Flutter riverpod state does not change

I try to use a StateNotifier with my own classes but whatever I do the state does not change. I use riverpod version ^1.0.4. When I execute a function in my StateNotifier the state in the function changes, but in the UI part, it does not change. The…
Berkkan
  • 97
  • 1
  • 4
  • 8
1
vote
1 answer

Flutter_riverpod giving me problems while installing

I am trying to install flutter_riverpod but it gives me these error messages by following the normal approaches on installing packages. That is from pub.dev I added flutter_riverpod: ^1.0.4 under my dependencies but gives me an error that…
Samuel
  • 472
  • 4
  • 14
1
vote
2 answers

TabController and Riverpod?

I would like to display the AsyncValue result from a Riverpod StatenotifierProvider in a TabControl. In a StatefulWidget I would have implemented the TabController like so: class Screen extends StatefulWidget { Screen({Key? key}) : super(key:…
Olf
  • 25
  • 4
1
vote
0 answers

Using Stram with Async in riverpod for state management

I am using Firebase with Flutter. Getting firebase stream from repository. In the StateNotifier class, using AsyncValue union class for state management using 'loading', 'data', and 'error' states in my ConsumerWidget. My Code: class MyTableNotifier…
Thr3e
  • 358
  • 1
  • 6
  • 22
1
vote
1 answer

How can I refresh all families of an always-alive provider manually in riverpod?

I have used family to cache all data. final provider = StateNotifierProvider.family((ref, data) => ListNotifier(ref, data)); I want to refresh all families of these providers. my provider receives an object and returns the same type of…
1
vote
2 answers

How to call a riverpod provider outside of widget tree/widget class?

I am new to using RiverPod. previously I used Provider for state management. in case of provider I could use a provider outside widget tree to get value using syntax Provider.of(context,listen:true).someFunction(); how do I do the same in…
Junaid Tariq
  • 568
  • 8
  • 22
1
vote
1 answer

Flutter Equivalent useProvider in new version of Riverpod

In previous version of riverpod we could use simply useProvider() and sending request to server without any action such as clicking on button, so in new version of riverpod i can't. old version: useEffect(() { …
DolDurma
  • 15,753
  • 51
  • 198
  • 377
1
vote
1 answer

How to re-render a Widget based on another widget using riverpod in flutter?

I want to know how can I refresh a table data (which is fetched from an API using a future provider) and re-render the table widget based on dropdown value change. Following is the Repo file with providers: import…