riverpod icon indicating copy to clipboard operation
riverpod copied to clipboard

AsyncValue Issue

Open LokiEvilOne opened this issue 2 months ago • 3 comments

When utilizing the balanceProvider, the balance.when() method does not consistently enter the loading state as expected. Instead, it either directly throws an error or fails to update the value properly, resulting in unexpected behavior.

balance.when( data: (balance) { setState(() { userBalance = balance; }); return customText( average: widget.average, value: "Balance: ${balance.floor()}", fontSize: topTextFontSize, fontColor: Colors.black, fontWeight: topTextFontWeight, ); }, error: (e, s) { return const Text("-"); }, loading: () { debugPrint("Running"); return const SizedBox( width: 50.0, child: LinearProgressIndicator(), ); }, ),

LokiEvilOne avatar Apr 08 '24 11:04 LokiEvilOne