update
This commit is contained in:
parent
a76d3a0f35
commit
e3dc94a768
33 changed files with 368 additions and 184 deletions
|
|
@ -2,6 +2,8 @@ import 'package:flutter/material.dart';
|
|||
import 'package:go_router/go_router.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:pharmacy_mobile/auth/auth_service.dart';
|
||||
import 'package:pharmacy_mobile/blocs/guest/functions/bloc_getgueststatus.dart';
|
||||
import 'package:pharmacy_mobile/blocs/guest/functions/bloc_setguestoff.dart';
|
||||
import 'package:pharmacy_mobile/widgets/buttonwithprogress_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/glossy_container_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/input_form_widget.dart';
|
||||
|
|
@ -55,10 +57,14 @@ class _LoginPageState extends State<LoginPage> {
|
|||
if (await InternetConnectionChecker.instance.hasConnection) {
|
||||
await _authService.signIn(email, password);
|
||||
|
||||
if (mounted) {
|
||||
final user = _authService.getCurrentUser();
|
||||
final user = _authService.getCurrentUser();
|
||||
|
||||
if (user != null) {
|
||||
if (user != null) {
|
||||
// ignore: use_build_context_synchronously
|
||||
final disableGuest = await blocSetGuestOff(context);
|
||||
|
||||
if (disableGuest) {
|
||||
// ignore: use_build_context_synchronously
|
||||
showNotification(context, 'Login Successful', true);
|
||||
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
|
|
@ -68,6 +74,9 @@ class _LoginPageState extends State<LoginPage> {
|
|||
if (mounted) context.push('/customer');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// ignore: use_build_context_synchronously
|
||||
showNotification(context, 'Error: Login failed', false);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue