update
This commit is contained in:
parent
064814e165
commit
47a2d34933
2 changed files with 62 additions and 64 deletions
|
|
@ -28,7 +28,7 @@ class _LoginPageState extends State<LoginPage> {
|
||||||
bool _isLoading = false;
|
bool _isLoading = false;
|
||||||
|
|
||||||
void _signIn() async {
|
void _signIn() async {
|
||||||
if (_isLoading) return;
|
// if (_isLoading) return;
|
||||||
|
|
||||||
final email = _emailController.text;
|
final email = _emailController.text;
|
||||||
final password = _passwordController.text;
|
final password = _passwordController.text;
|
||||||
|
|
|
||||||
|
|
@ -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/button_widget.dart';
|
||||||
import 'package:pharmacy_mobile/widgets/menu_widget.dart';
|
import 'package:pharmacy_mobile/widgets/menu_widget.dart';
|
||||||
import 'package:pharmacy_mobile/widgets/page_background_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/text_widget.dart';
|
||||||
import 'package:pharmacy_mobile/widgets/title_widget.dart';
|
import 'package:pharmacy_mobile/widgets/title_widget.dart';
|
||||||
|
|
||||||
|
|
@ -17,18 +18,12 @@ class MainPage extends StatelessWidget {
|
||||||
final authService = AuthService();
|
final authService = AuthService();
|
||||||
|
|
||||||
void signOut() async {
|
void signOut() async {
|
||||||
await authService.signOut().then((_) => {context.push('/')});
|
await authService.signOut().then((_) => {context.push('/'), showNotification(context, 'Logged Out', true)});
|
||||||
}
|
}
|
||||||
|
|
||||||
void gotoAddMedicine() {
|
return PopScope(
|
||||||
context.push('/addmedicines');
|
canPop: false,
|
||||||
}
|
child: Scaffold(
|
||||||
|
|
||||||
void gotoAddGenerics() {
|
|
||||||
context.push('/addgenerics');
|
|
||||||
}
|
|
||||||
|
|
||||||
return Scaffold(
|
|
||||||
resizeToAvoidBottomInset: false,
|
resizeToAvoidBottomInset: false,
|
||||||
body: SingleChildScrollView(
|
body: SingleChildScrollView(
|
||||||
child: PageBackgroundWidget(
|
child: PageBackgroundWidget(
|
||||||
|
|
@ -54,12 +49,15 @@ class MainPage extends StatelessWidget {
|
||||||
color: 'blue'),
|
color: 'blue'),
|
||||||
const Gap(16),
|
const Gap(16),
|
||||||
MenuWidget(
|
MenuWidget(
|
||||||
icon: FontAwesomeIcons.squarePlus, text: 'Add Generics', onPressed: gotoAddGenerics, color: 'blue'),
|
icon: FontAwesomeIcons.squarePlus,
|
||||||
|
text: 'Add Generics',
|
||||||
|
onPressed: () => {context.push('/addgenerics')},
|
||||||
|
color: 'blue'),
|
||||||
const Gap(32),
|
const Gap(32),
|
||||||
MenuWidget(
|
MenuWidget(
|
||||||
icon: FontAwesomeIcons.squarePlus,
|
icon: FontAwesomeIcons.squarePlus,
|
||||||
text: 'Add Medicine',
|
text: 'Add Medicine',
|
||||||
onPressed: gotoAddMedicine,
|
onPressed: () => {context.push('/addmedicines')},
|
||||||
color: 'green'),
|
color: 'green'),
|
||||||
const Gap(16),
|
const Gap(16),
|
||||||
MenuWidget(
|
MenuWidget(
|
||||||
|
|
@ -83,6 +81,6 @@ class MainPage extends StatelessWidget {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue