111
This commit is contained in:
@@ -6,6 +6,7 @@ import '../../../core/theme/app_spacing.dart';
|
||||
import '../../../core/theme/app_theme.dart';
|
||||
import '../../../core/theme/app_theme_extension.dart';
|
||||
import '../../../providers/auth_provider.dart';
|
||||
import '../../../main.dart';
|
||||
import '../../components/material_input.dart';
|
||||
import '../main/main_page.dart';
|
||||
import 'register_page.dart';
|
||||
@@ -275,19 +276,15 @@ class _LoginPageState extends State<LoginPage> {
|
||||
if (!mounted) return;
|
||||
|
||||
if (response.success) {
|
||||
_navigateToMainPage();
|
||||
navigatorKey.currentState?.pushAndRemoveUntil(
|
||||
MaterialPageRoute(builder: (_) => const MainPage()),
|
||||
(route) => false,
|
||||
);
|
||||
} else {
|
||||
_showErrorDialog(response.message ?? '用戶名或密碼錯誤');
|
||||
}
|
||||
}
|
||||
|
||||
void _navigateToMainPage() {
|
||||
Navigator.of(context).pushAndRemoveUntil(
|
||||
MaterialPageRoute(builder: (context) => const MainPage()),
|
||||
(route) => false,
|
||||
);
|
||||
}
|
||||
|
||||
void _navigateToRegister() {
|
||||
Navigator.push(
|
||||
context,
|
||||
|
||||
Reference in New Issue
Block a user