update
This commit is contained in:
parent
cf2ce36f87
commit
50d2cba7f2
9 changed files with 156 additions and 83 deletions
|
|
@ -6,6 +6,7 @@ import 'package:pharmacy_mobile/auth/auth_service.dart';
|
|||
import 'package:pharmacy_mobile/widgets/button_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/input_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/page_background_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/snackbar_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/text_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/title_widget.dart';
|
||||
import 'package:internet_connection_checker/internet_connection_checker.dart';
|
||||
|
|
@ -37,13 +38,7 @@ class _LoginPageState extends State<LoginPage> {
|
|||
if (await InternetConnectionChecker.instance.hasConnection) {
|
||||
await _authService.signIn(email, password);
|
||||
if (mounted) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
|
||||
content: Text('Login Successful'),
|
||||
backgroundColor: const Color.fromRGBO(37, 106, 32, 1),
|
||||
elevation: 4.0,
|
||||
behavior: SnackBarBehavior.floating,
|
||||
duration: Duration(seconds: 5),
|
||||
));
|
||||
showNotification(context, 'Login Successful', true);
|
||||
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (mounted) {
|
||||
|
|
@ -53,24 +48,12 @@ class _LoginPageState extends State<LoginPage> {
|
|||
}
|
||||
} else {
|
||||
if (mounted) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
|
||||
content: Text('No Internet Connection'),
|
||||
backgroundColor: const Color.fromRGBO(188, 59, 50, 1),
|
||||
elevation: 4.0,
|
||||
behavior: SnackBarBehavior.floating,
|
||||
duration: Duration(seconds: 5),
|
||||
));
|
||||
showNotification(context, 'Error: No Internet Connection', false);
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
if (mounted) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
|
||||
content: Text('Error: $e'),
|
||||
backgroundColor: const Color.fromRGBO(188, 59, 50, 1),
|
||||
elevation: 4.0,
|
||||
behavior: SnackBarBehavior.floating,
|
||||
duration: Duration(seconds: 5),
|
||||
));
|
||||
showNotification(context, 'Error: $e', false);
|
||||
}
|
||||
} finally {
|
||||
setState(() => _isLoading = false);
|
||||
|
|
@ -110,7 +93,8 @@ class _LoginPageState extends State<LoginPage> {
|
|||
child: Container(
|
||||
padding: EdgeInsets.fromLTRB(32, 32, 32, 40),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color.fromRGBO(38, 17, 46, 0.859),
|
||||
// color: const Color.fromRGBO(38, 17, 46, 0.859),
|
||||
color: const Color.fromRGBO(57, 38, 62, 0.9),
|
||||
borderRadius: BorderRadius.all(Radius.circular(16)),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue