Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
9 views

How to update Flutter riverpod to version >= 2 (using riverpod decorator)

I have a flutter app and I am using flutter_riverpod: ^2.5.1 ... And my code is: import 'package:flutter_riverpod/flutter_riverpod.dart'; class PersonState { int age; String? name PersonState({...
Germano's user avatar
  • 624
0 votes
1 answer
7 views

How to properly react to changes from other providers using Riverpod?

currently BatchSizeNotifier reset ProgressNotifier when it changes, but I would like ProgressNotifier to reset itself when BatchSizeNotifier changes by listening to it, but it doesn't seem to work. ...
Fractale's user avatar
  • 1,622
0 votes
0 answers
54 views

Riverpod ref.read calls build method and returns initial state

In my flutter app I want to use InAppWebView and riverpod , So I created : @riverpod class WebViewController extends _$WebViewController { @override InAppWebViewController? build() { return ...
Cyrus the Great's user avatar
1 vote
1 answer
52 views

Riverpod VSCode quick refactoring options are absent

Hello Please help with Riverpod. Everything works on the command line (Code generation, etc) But VSCode quick refactoring options are absent. I have analysis_options.yaml with : analyzer: plugins: ...
Audrius M's user avatar
0 votes
1 answer
44 views

Riverpod Annotations Compiler Errors

I have attempted to add Riverpod to a Flutter project and use its annotations which then produce errors. I then created a new project and followed exactly what the Getting Started shows, however, ...
C6Silver's user avatar
  • 3,327
0 votes
0 answers
32 views

flutter_hooks - how to access TextEditingController outside the build()-method?

Flutter hooks needs to be created within the build method of a widget by design. Let's assume I have a hook for using a TextEditingController, how can I access the TextEditingController outside the ...
user28298940's user avatar
0 votes
0 answers
31 views

How to test two providers in Flutter / Riverpod?

I have 2 providers, Provider1 and Provider2, where Provider1 uses Provider2 in this way: @riverpod class Provider1Notifier extends _$Provider1Notifier with PersistenceHelper { .... void buy(int ...
Randomize's user avatar
  • 9,093
0 votes
1 answer
56 views

Moving my riverpods generated files to a dedicated folder

I'm doing some cleaning in my project, therefore I want to move my generated files to an other folder to improve the readability. I've managed to move freezed files but not riverpod This is my build....
imGok's user avatar
  • 68
0 votes
0 answers
19 views

Managing StreamChatClient Initialization and Connection with Riverpod: Architecture Advice

Background: I’m using StreamChat in my Flutter app. The documentation mentions that the StreamChatClient should only be initialized once and client.connectUser() should only be called once to avoid ...
iacomus's user avatar
  • 45
0 votes
2 answers
123 views

Riverpod problem with instantiating multiple providers of same type

This is more about a theoretical discussion of flutter riverpod state management package. Currently I am trying to migrate one kinda huge project from Provider to Riverpod and I encountered an issue ...
Pavel Pek's user avatar
0 votes
1 answer
36 views

Duplicate Key error while using GoRouter StatefulShellRoute with redirect

I'm using GoRouter for navigation in my Flutter app, but while using the redirect function with StatefulShellRoute, I get a Duplicate Globalkey error. I've attached the minimal reproduction code (The ...
SHUVAM JASWAL's user avatar
0 votes
0 answers
51 views

How to initialize Isar using riverpod?

I use IsarDb as local db. I follow a method. But its sometime not initialize. please check my code. and provide a better solution or inform me where is issue. Some time it shows Isar not initialized. ...
Abdul Kader Hridoy's user avatar
0 votes
0 answers
27 views

How to use firebase_auth_mocks with firebase_ui_auth to mock the sign in to a flutter app during integration testing

I am trying to use the firebase_auth_mocks package along with firebase_ui_auth, Riverpod, and patrol_finders to perform integration testing. To learn how to do this, I have created a minimal app with ...
Philip Johnson's user avatar
0 votes
2 answers
47 views

How to pass Exception in sync riverpod provider?

I have a provider which throws an exception which I want to handle where I read the provider: @Riverpod(dependencies: [firebaseAuth]) User currentUser(CurrentUserRef ref) { final user = ref.watch(...
Dario Digregorio's user avatar
0 votes
0 answers
67 views

How to implement this type of Multi Dependent Dropdown using ValueNotifiers and FutureProviders from Riverpod 2

I have 3 API calls made using Riverpod Future Provider and family modifier in last two: getAllCategoriesProvider, getSubCategoriesByCategoryIdProvider, getBrandsBySubCategoryIdProvider My current code ...
Nikhil Kumar's user avatar
0 votes
1 answer
71 views

Is it okay to make a nested ConsumerStatefulWidget? [closed]

Is it okay to make a nested ConsumerStatefulWidget in a single screen? Each ConsumerStatefulWidget has ref.watch(someAsyncNotifierProvider) in it.
Jinwook Kim's user avatar
1 vote
0 answers
76 views

How do I read a Riverpod provider within a Class or Stream without Ref or context?

I have a Class I use for backend, within which I have a Stream that Streams data from Firebase, as shown below. I need to access the data from a Riverpod Provider to specify the Firebase collection ...
Dan12314's user avatar
  • 115
0 votes
1 answer
76 views

How to setup the state management architecture for current use case? [closed]

In my flutter application, I'll be having multiple pages. Consider 2 pages for now. Both these pages have some filters that are common and can be modified from either page. Both these pages also have ...
Aurora Borealis's user avatar
0 votes
1 answer
37 views

Flutter Riverpod 2.5.1 not updating StateNotifier value on read

I have a flutter app and I want to use flutter_riverpod as a global state manager. The problem is that I cant access my variable even when i use the read method. What am I doing wrong? My Screen code: ...
Germano's user avatar
  • 624
0 votes
1 answer
102 views

How to properly initialize a StateProvider with an initial value in a screen using Riverpod in Flutter?

What I'm trying to understand is the best way to initialize a provider using the parameters passed to the widget. Specifically, I need to set the initial state of a FilterProvider based on the value ...
Guilherme Bernardino's user avatar
0 votes
0 answers
23 views

How to update a dynamic riverpod UI after configuration changed?

How to update a dynamic riverpod UI after configuration changed? It feels like bad style to tie the viewmodels to a specific configuration backend which may change in the future. So there should ...
Ulfhetnar's user avatar
  • 711
1 vote
1 answer
71 views

cant go to the next screen with context.go of go_router when using asyncnotifier to call an api and store value in the DB

I am using an asyncnotifier to run background task of configuration and would like to use a loading screen which will get dismissed and go tho the next screen once the async is done. Here is my code : ...
Armando Sudi's user avatar
0 votes
0 answers
55 views

Flutter: Item is added only when button is pressed twice or more (Riverpod Inventory management)

I have an app that has an inventory of Items and I followed very similar approach to delete, add, update items methods; but add button is only working when pressed twice. If I press it 4 times, same ...
Stooges4's user avatar
0 votes
0 answers
89 views

integrating shared_preferences into riverpod

I am looking to use shared_preferences with riverpod. I'm a riverpod novice and have never worked with shared_preferences before, so I was looking for a guide on/example of how to combine the two. I ...
Rea Mart's user avatar
0 votes
0 answers
55 views

Flutter all widgets are rebuilding on keyboard open or close

The app looks like this: ProviderScope( child: MaterialApp.router( I have a bottom nav and the next flow: Bottom nav at index 0 has a widget A Widget A has a list and tapping on a list item opens ...
Stefan's user avatar
  • 145
1 vote
1 answer
75 views

I don't know how to mock Riverpod's Provider with mockito

I am writing a test in Flutter using mockito, I want to mock Riverpod's Provider, but I get an error and can't solve it. The various versions are as follows # pubspec.yaml environment: sdk: ^3.5.2 ...
akkie's user avatar
  • 13
2 votes
1 answer
41 views

Flutter Riverpod Image is not removing from UI

import 'dart:io'; import 'package:flutter/material.dart'; import 'package:flutter/src/widgets/framework.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:image_picker/...
Anbarasan Nethaji's user avatar
0 votes
0 answers
68 views

Riverpod: Integrating a Single Endpoint Across Multiple Stepper Screens in Flutter + Riverpod

Question: I'm building a Flutter application with a stepper wizard, consisting of 4-5 separate screens (each in its own file). Each screen contains various form fields (text fields, dropdowns, date ...
Muhammad Ali's user avatar
0 votes
1 answer
67 views

Flutter App hangs at build: Loading a Json Asset and Using Riverpod

I will try to be brief and only add relevant pieces of code. This is the screen that tries to load Item objects from a JSON: Widget _buildItemList(List<Item> currentItemList) { return ListView....
Stooges4's user avatar
1 vote
1 answer
45 views

How to change `HintText` and `Border` color to red on error for both Username and Password fields in Flutter?

Question: I want the hintText and border color of both the username and password fields to turn red when there's an error. However, only the password field is working correctly, while the username ...
Muhammad Ali's user avatar
0 votes
1 answer
57 views

Dart Riverpod merging two providers of the same type

I am looking for a way to combine two providers (that both emit the same type of values) into one such that the resulting provider emits the most recent value emitted by either of the two input ...
gruvw's user avatar
  • 950
0 votes
1 answer
40 views

Showing a list of posts in Flutter

I have a social media app which like any other social media apps shows a list of posts which is vertically scrollable. So the problem is that it the functionality isn't working as expected and I don't ...
khomotjo_codes's user avatar
1 vote
1 answer
109 views

Flutter Riverpod Streamprovider with Firebase Document Listener

I have written a riverpod stream provider in flutter, which should wait after successful authentication of the user until the user document exists. if this exists, the document should be read out and ...
Chris's user avatar
  • 155
2 votes
2 answers
283 views

How to access the route data outside the StatefulNavigationShell with GoRouter in Flutter?

First of all, thank you very much for helping me with this challenge ! What I Try To Achieve My Flutter Desktop app is splitted between a Navigation side bar, and a content area. Only the content area ...
Julien Elkaim's user avatar
-2 votes
2 answers
71 views

Is riverpod the best way to display/collect input from multiple textformfields on multiple tabs? [closed]

Given the following page with 3 tabs that all contain multiple textfields, is using the riverpod library the best/easiest way to both set and collect values from each tab's textformfield widgets? The ...
Evan R.'s user avatar
  • 1,244
-1 votes
1 answer
131 views

Riverpod 2.5 and Firebase

I'm currently working with Riverpod 2.5 and Google Sign-In, and I'm trying to figure out how to integrate Riverpod with it. Riverpod 2.5 recommends not using StateProvider and ChangeNotifier. ...
DAni M's user avatar
  • 771
1 vote
0 answers
18 views

Read Firebase data as soon as available Flutter [duplicate]

I have tried to implement a login system with riverpod and firebase in flutter. This should be implemented in such a way that as soon as the login state of Firebase changes, all user data should be ...
Pantastix's user avatar
  • 340
0 votes
0 answers
121 views

How to Maintain Rounded Corners with Full Background Color in Flutter Sidebar?

Question: I'm working on a Flutter Windows app and trying to achieve a sidebar design with rounded corners and a full background color. However, I'm having trouble maintaining the rounded corners when ...
Muhammad Ali's user avatar
0 votes
1 answer
44 views

My code is losing state when I switch from one screen to another in flutter app

I have a flutter app where a new user is taken to the user profile screen. Here they can enter more information and save the data. Just before the save method, I put all the data into a riverpod ...
LostTexan's user avatar
  • 855
0 votes
1 answer
52 views

How to execute member method in FamilyAsyncNotifier of riverpod?

How to execute member method in FamilyAsyncNotifier? (This is kind of continuous question to my previous question.) I initialized my FamilyAsyncNotifier by passing parameter to it. However, now I am ...
foseja's user avatar
  • 341
1 vote
2 answers
292 views

Passing parameter to AsyncNotifier of Riverpod in Flutter

I would like to initialize an AsyncNotifier with parameter. I have looked at a couple answers on SO but I have not been able to find one for my case. (This might work if I used annotation approach but ...
foseja's user avatar
  • 341
2 votes
0 answers
50 views

flutter jumps back to the last route

I want to build a loading screen for my flutter app, which includes a small start animation. The goal is that the loading screen is only left when a 4 second timer has expired and the data is loaded. ...
Chris's user avatar
  • 155
0 votes
0 answers
139 views

Flutter: 'build_runner' not generating the '.g.dart' file

running 'dart run build_runner watch' isn't generating 'g.dart' file Here is the code - annotation provided, 'part' added - name of the file is correct. Dependencies are added correctly. When i run ...
user27088974's user avatar
0 votes
1 answer
59 views

How do I unit test for controller initial state when AsyncData is a List<Object>

I have a test testing for the initial state of a controller. It keeps failing saying no matching calls, but my other controller tests using the same code are fine (the difference is they have an ...
steve's user avatar
  • 907
1 vote
1 answer
94 views

AsyncValue.guard results with AsyncLoading

I have a riverpod provider which stuck in the AsyncLoading state for weird reason. Should be AsyncData after AsyncValue.guard, but stays in AsyncLoading state indefinitely @riverpod class ...
Dcow's user avatar
  • 1,463
0 votes
1 answer
53 views

Read state of provider without passing arguments again

Let me preface this that I'm very new to Flutter and coming from Rails where current_user was much simpler to setup. I'm creating a functional currentUserProvider: @riverpod User currentUser(...
bkunzi01's user avatar
  • 4,561
0 votes
1 answer
52 views

obtain response after making request in user interaction

When a button is pressed, I'm displaying a message in the SnackBar when sending the request. I'd like to also display the response once it arrives. I've played for a while, and I expected ref.read(...
Chema's user avatar
  • 745
0 votes
0 answers
126 views

Proper way of implementing Auth Guard in Flutter App with auto_route

Well, in my application it uses riverpod and autoroute and unfortunately I have a problem with guard here. I would like my app to display DashboardPage if isAuthenticated == true and WelcomePage ...
bleiddze's user avatar
-1 votes
1 answer
43 views

Calling api call using riverpod onClick Listener in flutter

I'm trying to call the same api call using dio and listen to that api call using riverpod , but the issue is that when i call the api call in the build function , it works but when i call the same api ...
Taki's user avatar
  • 3,700
0 votes
1 answer
105 views

How to reset the state of FutureProvider in Riverpod

Problem description: When the user enters the page, loading is displayed, and then the network request is automatically executed. If the request is successful, the relevant data is displayed. If the ...
Liu Silong's user avatar
  • 5,522

1
2 3 4 5
30