diff --git a/apps/lib/features/auth/ui/screens/register_verification_screen.dart b/apps/lib/features/auth/ui/screens/register_verification_screen.dart index cc0e4ff..93137db 100644 --- a/apps/lib/features/auth/ui/screens/register_verification_screen.dart +++ b/apps/lib/features/auth/ui/screens/register_verification_screen.dart @@ -6,7 +6,7 @@ import 'package:go_router/go_router.dart'; import 'package:formz/formz.dart'; import '../../../../core/theme/design_tokens.dart'; import '../../../../shared/widgets/app_button.dart'; -import '../../../../shared/widgets/banner/app_banner.dart'; +import '../../../../shared/widgets/toast/toast.dart'; import '../../../../shared/widgets/toast/toast_type.dart'; import '../../presentation/cubits/register_cubit.dart'; import '../../presentation/bloc/auth_bloc.dart'; @@ -98,6 +98,7 @@ class _RegisterVerificationViewState extends State { if (success && mounted) { _startCountdown(); + Toast.show(context, '验证码已发送', type: ToastType.success); } } @@ -173,7 +174,12 @@ class _RegisterVerificationViewState extends State { } Widget _buildFormContainer() { - return BlocBuilder( + return BlocConsumer( + listener: (context, state) { + if (state.errorMessage != null && !state.isStep2Valid) { + Toast.show(context, state.errorMessage!, type: ToastType.error); + } + }, builder: (context, state) { return SizedBox( width: 327, @@ -183,14 +189,6 @@ class _RegisterVerificationViewState extends State { _buildCodeInput(state), const SizedBox(height: 12), _buildStepIndicator(), - if (state.errorMessage != null) - Padding( - padding: const EdgeInsets.only(top: 8), - child: AppBanner( - message: state.errorMessage!, - type: ToastType.error, - ), - ), const SizedBox(height: 12), AppButton( text: '完成注册',