update loaing
This commit is contained in:
@@ -8,6 +8,7 @@ import 'package:flutter/material.dart';
|
||||
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:worker/core/widgets/loading_indicator.dart';
|
||||
import 'package:worker/core/constants/ui_constants.dart';
|
||||
import 'package:worker/core/theme/colors.dart';
|
||||
import 'package:worker/core/utils/validators.dart';
|
||||
@@ -294,15 +295,9 @@ class _ForgotPasswordPageState extends ConsumerState<ForgotPasswordPage> {
|
||||
),
|
||||
),
|
||||
child: _isLoading
|
||||
? SizedBox(
|
||||
height: 20.0,
|
||||
width: 20.0,
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 2.0,
|
||||
valueColor: AlwaysStoppedAnimation<Color>(
|
||||
colorScheme.onPrimary,
|
||||
),
|
||||
),
|
||||
? CustomLoadingIndicator(
|
||||
color: colorScheme.onPrimary,
|
||||
size: 20,
|
||||
)
|
||||
: const Text(
|
||||
'Gửi mã OTP',
|
||||
|
||||
@@ -8,6 +8,7 @@ import 'package:flutter/material.dart';
|
||||
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:worker/core/widgets/loading_indicator.dart';
|
||||
import 'package:worker/core/constants/ui_constants.dart';
|
||||
import 'package:worker/core/router/app_router.dart';
|
||||
import 'package:worker/core/theme/colors.dart';
|
||||
@@ -483,15 +484,9 @@ class _LoginPageState extends ConsumerState<LoginPage> {
|
||||
),
|
||||
),
|
||||
child: isLoading
|
||||
? SizedBox(
|
||||
height: 20.0,
|
||||
width: 20.0,
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 2.0,
|
||||
valueColor: AlwaysStoppedAnimation<Color>(
|
||||
colorScheme.onPrimary,
|
||||
),
|
||||
),
|
||||
? CustomLoadingIndicator(
|
||||
color: colorScheme.onPrimary,
|
||||
size: 20,
|
||||
)
|
||||
: const Text(
|
||||
'Đăng nhập',
|
||||
|
||||
@@ -11,6 +11,7 @@ import 'package:flutter/services.dart';
|
||||
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:worker/core/widgets/loading_indicator.dart';
|
||||
|
||||
import 'package:worker/core/constants/ui_constants.dart';
|
||||
import 'package:worker/core/router/app_router.dart';
|
||||
@@ -377,15 +378,9 @@ class _OtpVerificationPageState extends ConsumerState<OtpVerificationPage> {
|
||||
),
|
||||
),
|
||||
child: _isLoading
|
||||
? SizedBox(
|
||||
height: 20,
|
||||
width: 20,
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 2,
|
||||
valueColor: AlwaysStoppedAnimation<Color>(
|
||||
colorScheme.onPrimary,
|
||||
),
|
||||
),
|
||||
? CustomLoadingIndicator(
|
||||
color: colorScheme.onPrimary,
|
||||
size: 20,
|
||||
)
|
||||
: const Text(
|
||||
'Xác nhận',
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
library;
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:worker/core/widgets/loading_indicator.dart';
|
||||
import 'package:worker/core/theme/colors.dart';
|
||||
|
||||
/// Splash Page
|
||||
@@ -61,10 +62,7 @@ class SplashPage extends StatelessWidget {
|
||||
const SizedBox(height: 48.0),
|
||||
|
||||
// Loading Indicator
|
||||
CircularProgressIndicator(
|
||||
valueColor: AlwaysStoppedAnimation<Color>(colorScheme.primary),
|
||||
strokeWidth: 3.0,
|
||||
),
|
||||
const CustomLoadingIndicator(),
|
||||
|
||||
const SizedBox(height: 16.0),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user