update loaing

This commit is contained in:
Phuoc Nguyen
2025-12-02 18:09:20 +07:00
parent fc9b5e967f
commit 19d9a3dc2d
75 changed files with 216 additions and 292 deletions

View File

@@ -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();
}
```