update loaing
This commit is contained in:
@@ -31,7 +31,7 @@ Future<User> user(UserRef ref, String id) async {
|
||||
final userAsync = ref.watch(userProvider('123'));
|
||||
userAsync.when(
|
||||
data: (user) => Text(user.name),
|
||||
loading: () => CircularProgressIndicator(),
|
||||
loading: () => const CustomLoadingIndicator(),
|
||||
error: (e, _) => Text('Error: $e'),
|
||||
);
|
||||
```
|
||||
@@ -202,7 +202,7 @@ final newValue = ref.refresh(userProvider);
|
||||
```dart
|
||||
asyncValue.when(
|
||||
data: (value) => Text(value),
|
||||
loading: () => CircularProgressIndicator(),
|
||||
loading: () => const CustomLoadingIndicator(),
|
||||
error: (error, stack) => Text('Error: $error'),
|
||||
);
|
||||
```
|
||||
@@ -215,7 +215,7 @@ switch (asyncValue) {
|
||||
case AsyncError(:final error):
|
||||
return Text('Error: $error');
|
||||
case AsyncLoading():
|
||||
return CircularProgressIndicator();
|
||||
return const CustomLoadingIndicator();
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user