update
This commit is contained in:
parent
06531e3959
commit
f0d6bca4f3
135 changed files with 19329 additions and 22 deletions
|
|
@ -27,6 +27,15 @@ class _LoginPageState extends State<LoginPage> {
|
|||
|
||||
bool _isLoading = false;
|
||||
|
||||
void checkLoggedIn() async {
|
||||
final user = _authService.getCurrentUser();
|
||||
if (user == null) {
|
||||
context.push('/');
|
||||
} else {
|
||||
context.push('/main');
|
||||
}
|
||||
}
|
||||
|
||||
void _signIn() async {
|
||||
// if (_isLoading) return;
|
||||
|
||||
|
|
@ -55,13 +64,16 @@ class _LoginPageState extends State<LoginPage> {
|
|||
|
||||
if (mounted) {
|
||||
final user = _authService.getCurrentUser();
|
||||
showNotification(context, 'Login Successful', true);
|
||||
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (mounted) {
|
||||
context.push('/main');
|
||||
}
|
||||
});
|
||||
if (user != null) {
|
||||
showNotification(context, 'Login Successful', true);
|
||||
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (mounted) {
|
||||
context.push('/main');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (mounted) {
|
||||
|
|
@ -90,6 +102,12 @@ class _LoginPageState extends State<LoginPage> {
|
|||
// }
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
checkLoggedIn();
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_emailController.dispose();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue