update
This commit is contained in:
parent
2d3f5bd96e
commit
f4119130a6
17 changed files with 232 additions and 138 deletions
|
|
@ -1,9 +1,11 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:glossy/glossy.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/widgets/buttonwithprogress_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/glossy_container_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';
|
||||
|
|
@ -25,7 +27,8 @@ class _LoginPageState extends State<LoginPage> {
|
|||
final _passwordController = TextEditingController();
|
||||
final FocusNode _focusNode = FocusNode();
|
||||
|
||||
bool _isLoading = false;
|
||||
late bool _isLoading = false;
|
||||
late double containerHeight = 0.35;
|
||||
|
||||
void _signIn() async {
|
||||
final email = _emailController.text;
|
||||
|
|
@ -45,7 +48,10 @@ class _LoginPageState extends State<LoginPage> {
|
|||
return;
|
||||
}
|
||||
|
||||
setState(() => _isLoading = true);
|
||||
setState(() {
|
||||
_isLoading = true;
|
||||
containerHeight = 0.365;
|
||||
});
|
||||
|
||||
try {
|
||||
if (await InternetConnectionChecker.instance.hasConnection) {
|
||||
|
|
@ -82,7 +88,10 @@ class _LoginPageState extends State<LoginPage> {
|
|||
}
|
||||
}
|
||||
} finally {
|
||||
setState(() => _isLoading = false);
|
||||
setState(() {
|
||||
_isLoading = false;
|
||||
containerHeight = 0.35;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -118,19 +127,8 @@ class _LoginPageState extends State<LoginPage> {
|
|||
const Gap(16),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 32, right: 32),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.fromLTRB(32, 32, 32, 40),
|
||||
decoration: const BoxDecoration(
|
||||
color: Color.fromRGBO(57, 38, 62, 0.6),
|
||||
borderRadius: BorderRadius.all(Radius.circular(16)),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Color.fromRGBO(0, 0, 0, 0.2), // Subtle shadow to give depth
|
||||
spreadRadius: 0,
|
||||
blurRadius: 4,
|
||||
offset: Offset(0, 2),
|
||||
)
|
||||
]),
|
||||
child: GlossyContainerWidget(
|
||||
height: containerHeight,
|
||||
child: Form(
|
||||
child: Column(
|
||||
children: [
|
||||
|
|
@ -150,11 +148,6 @@ class _LoginPageState extends State<LoginPage> {
|
|||
),
|
||||
),
|
||||
const Gap(40),
|
||||
// TextButton(onPressed: () => {_signIn()}, child: const Text('Login'))
|
||||
// if (_isLoading)
|
||||
// const Center(child: CircularProgressIndicator(color: Color.fromRGBO(255, 255, 255, 1)))
|
||||
// else
|
||||
// ButtonWidget(text: 'Login', onPressed: _signIn),
|
||||
ButtonWithProgressWidget(
|
||||
trigger: _isLoading, progressText: 'Logging In', buttonText: 'Login', onPressed: _signIn)
|
||||
],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue