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

@@ -12,6 +12,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:go_router/go_router.dart';
import 'package:image_picker/image_picker.dart';
import 'package:worker/core/widgets/loading_indicator.dart';
import 'package:worker/core/constants/ui_constants.dart';
import 'package:worker/core/router/app_router.dart';
@@ -410,18 +411,8 @@ class _RegisterPageState extends ConsumerState<RegisterPage> {
centerTitle: false,
),
body: _isLoadingData
? Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const CircularProgressIndicator(),
const SizedBox(height: AppSpacing.md),
Text(
'Đang tải dữ liệu...',
style: TextStyle(color: colorScheme.onSurfaceVariant),
),
],
),
? const CustomLoadingIndicator(
message: 'Đang tải dữ liệu...',
)
: SafeArea(
child: Form(
@@ -646,15 +637,9 @@ class _RegisterPageState extends ConsumerState<RegisterPage> {
),
),
child: _isLoading
? SizedBox(
height: 20,
width: 20,
child: CircularProgressIndicator(
strokeWidth: 2,
valueColor: AlwaysStoppedAnimation<Color>(
colorScheme.onPrimary,
),
),
? CustomLoadingIndicator(
color: colorScheme.onPrimary,
size: 20,
)
: const Text(
'Đăng ký',
@@ -801,9 +786,12 @@ class _RegisterPageState extends ConsumerState<RegisterPage> {
},
);
},
loading: () => const SizedBox(
loading: () => SizedBox(
height: 48,
child: Center(child: CircularProgressIndicator()),
child: CustomLoadingIndicator(
color: colorScheme.primary,
size: 20,
),
),
error: (error, stack) => Container(
height: 48,
@@ -867,9 +855,12 @@ class _RegisterPageState extends ConsumerState<RegisterPage> {
},
);
},
loading: () => const SizedBox(
loading: () => SizedBox(
height: 48,
child: Center(child: CircularProgressIndicator()),
child: CustomLoadingIndicator(
color: colorScheme.primary,
size: 20,
),
),
error: (error, stack) => Container(
height: 48,