Questions tagged [asyncvalue]

5 questions
3
votes
3 answers

How to ("partially") update AsyncValue in riverpod?

The riverpod (v2) documentation contains two great examples how a TODO-list could be implemented using either a Notifier or an AsyncNotifier. Both examples are functionally equivalent. To pick one particular detail the non-async example contains a…
Vinci
  • 1,382
  • 10
  • 12
2
votes
0 answers

Flutter Riverpod: Show data and loading state at the same time

I have a UI in my app that shows a list of notifications! I added pull to refresh which gets the list of notifications again from the api. I use Async value to display the list of notifications and also a loading state when it is loading. What i…
Raymond Ativie
  • 1,747
  • 2
  • 26
  • 50
1
vote
1 answer

Riverpod - equivalent of select() to an AsyncValue object from an AsyncNotifierProvider

Good day everyone! I've got a doubt that sadly couldn't be found here. Here is the deal: I'm building an application in MVVM architecture + Clean code, trying to separate the logic concepts of the screen into the controller that is going to be used…
1
vote
1 answer

Riverpod's AsyncValue's when method's properties loading: and error: does not work as official document

According to https://pub.dev/documentation/riverpod/latest/riverpod/AsyncValue-class.html , I created the following code; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; class User { final name =…
kodaira
  • 31
  • 6
0
votes
1 answer

How to set multiple StateNotifierProvider (s) with dynamicaly loaded async data?

I'm completely stuck with the task below. So, the idea is to solve these steps using Riverpod Fetch data from db with some kind of Future async while pausing the app (display SomeLoadingPage() etc.) Once the data has loaded: 2.1 initialize…
Bohdan
  • 128
  • 6