update
This commit is contained in:
parent
3e6781a0bd
commit
5469c484e1
10 changed files with 204 additions and 48 deletions
45
lib/pages/add_medicine.dart
Normal file
45
lib/pages/add_medicine.dart
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:pharmacy_mobile/widgets/text_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/title_widget.dart';
|
||||
|
||||
class AddMedicinePage extends StatefulWidget {
|
||||
const AddMedicinePage({super.key});
|
||||
|
||||
@override
|
||||
AddMedicinePageState createState() => AddMedicinePageState();
|
||||
}
|
||||
|
||||
class AddMedicinePageState extends State<AddMedicinePage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: Container(
|
||||
alignment: Alignment.center,
|
||||
height: MediaQuery.of(context).size.height,
|
||||
decoration: const BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [
|
||||
Color.fromRGBO(34, 51, 69, 1),
|
||||
Color.fromRGBO(22, 32, 44, 1),
|
||||
],
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
),
|
||||
),
|
||||
child: Center(
|
||||
child: Column(
|
||||
children: [
|
||||
const Gap(120),
|
||||
const TitleWidget(firstTextSize: 16, secondTextSize: 32),
|
||||
const Gap(32),
|
||||
const TextWidget(text: 'Add Medicine'),
|
||||
const Gap(16),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -2,12 +2,17 @@ import 'package:flutter/material.dart';
|
|||
import 'package:go_router/go_router.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:pharmacy_mobile/widgets/button_widget.dart';
|
||||
|
||||
class IndexPage extends StatelessWidget {
|
||||
const IndexPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
void gotoLogin() {
|
||||
context.push('/login');
|
||||
}
|
||||
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
body: Container(
|
||||
|
|
@ -40,8 +45,8 @@ class IndexPage extends StatelessWidget {
|
|||
child: Image.asset('assets/ph_logo.webp',
|
||||
width: 256, cacheWidth: (256 * MediaQuery.of(context).devicePixelRatio).round()),
|
||||
),
|
||||
const Gap(16),
|
||||
TextButton(onPressed: () => {context.push('/login')}, child: const Text('Login'))
|
||||
const Gap(32),
|
||||
ButtonWidget(text: 'Login', onPressed: gotoLogin)
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:pharmacy_mobile/auth/auth_service.dart';
|
||||
import 'package:pharmacy_mobile/main.dart';
|
||||
import 'package:pharmacy_mobile/widgets/button_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/text_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/title_widget.dart';
|
||||
import 'dart:developer';
|
||||
import 'package:quickalert/quickalert.dart';
|
||||
|
||||
|
|
@ -18,6 +22,7 @@ class _LoginPageState extends State<LoginPage> {
|
|||
final _authService = AuthService();
|
||||
final _emailController = TextEditingController();
|
||||
final _passwordController = TextEditingController();
|
||||
final FocusNode _focusNode = FocusNode();
|
||||
|
||||
void _signIn() async {
|
||||
final email = _emailController.text;
|
||||
|
|
@ -81,16 +86,9 @@ class _LoginPageState extends State<LoginPage> {
|
|||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
const Gap(120),
|
||||
Text('Ofelia Franco-Alcala',
|
||||
style: GoogleFonts.outfit(
|
||||
textStyle: const TextStyle(color: Color.fromRGBO(255, 255, 255, 1), fontSize: 16))),
|
||||
Text('Pharmacy',
|
||||
style: GoogleFonts.outfit(
|
||||
textStyle: const TextStyle(color: Color.fromRGBO(255, 255, 255, 1), fontSize: 32))),
|
||||
const TitleWidget(firstTextSize: 16, secondTextSize: 32),
|
||||
const Gap(32),
|
||||
Text('Login',
|
||||
style: GoogleFonts.outfit(
|
||||
textStyle: const TextStyle(color: Color.fromRGBO(255, 255, 255, 1), fontSize: 32))),
|
||||
const TextWidget(text: 'Login'),
|
||||
const Gap(16),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 16, right: 16),
|
||||
|
|
@ -110,17 +108,26 @@ class _LoginPageState extends State<LoginPage> {
|
|||
style: const TextStyle(color: Colors.white),
|
||||
),
|
||||
const Gap(8),
|
||||
TextFormField(
|
||||
obscureText: true,
|
||||
controller: _passwordController,
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'Password',
|
||||
border: OutlineInputBorder(),
|
||||
KeyboardListener(
|
||||
focusNode: _focusNode,
|
||||
onKeyEvent: (event) {
|
||||
if (event is KeyDownEvent && event.logicalKey == LogicalKeyboardKey.enter) {
|
||||
_signIn();
|
||||
}
|
||||
},
|
||||
child: TextFormField(
|
||||
obscureText: true,
|
||||
controller: _passwordController,
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'Password',
|
||||
border: OutlineInputBorder(),
|
||||
),
|
||||
style: const TextStyle(color: Colors.white),
|
||||
),
|
||||
style: const TextStyle(color: Colors.white),
|
||||
),
|
||||
const Gap(16),
|
||||
TextButton(onPressed: () => {_signIn()}, child: const Text('Login'))
|
||||
// TextButton(onPressed: () => {_signIn()}, child: const Text('Login'))
|
||||
ButtonWidget(text: 'Login', onPressed: _signIn)
|
||||
],
|
||||
)),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -4,7 +4,10 @@ import 'package:gap/gap.dart';
|
|||
import 'package:go_router/go_router.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:pharmacy_mobile/auth/auth_service.dart';
|
||||
import 'package:pharmacy_mobile/widgets/button_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/menu_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/text_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/title_widget.dart';
|
||||
|
||||
class MainPage extends StatelessWidget {
|
||||
const MainPage({super.key});
|
||||
|
|
@ -18,6 +21,10 @@ class MainPage extends StatelessWidget {
|
|||
context.push('/');
|
||||
}
|
||||
|
||||
void gotoAddMedicine() {
|
||||
context.push('/addmedicines');
|
||||
}
|
||||
|
||||
return Scaffold(
|
||||
body: Container(
|
||||
alignment: Alignment.center,
|
||||
|
|
@ -36,27 +43,41 @@ class MainPage extends StatelessWidget {
|
|||
child: Column(
|
||||
children: [
|
||||
const Gap(120),
|
||||
Text('Ofelia Franco-Alcala',
|
||||
style: GoogleFonts.outfit(
|
||||
textStyle: const TextStyle(color: Color.fromRGBO(255, 255, 255, 1), fontSize: 16))),
|
||||
Text('Pharmacy',
|
||||
style: GoogleFonts.outfit(
|
||||
textStyle: const TextStyle(color: Color.fromRGBO(255, 255, 255, 1), fontSize: 32))),
|
||||
const TitleWidget(firstTextSize: 16, secondTextSize: 32),
|
||||
const Gap(32),
|
||||
Text('Menu',
|
||||
style: GoogleFonts.outfit(
|
||||
textStyle: const TextStyle(color: Color.fromRGBO(255, 255, 255, 1), fontSize: 32))),
|
||||
const TextWidget(text: 'Menu'),
|
||||
const Gap(16),
|
||||
MenuWidget(
|
||||
icon: FontAwesomeIcons.squarePlus,
|
||||
text: 'Add Medicine',
|
||||
onPressed: gotoAddMedicine,
|
||||
),
|
||||
const Gap(16),
|
||||
MenuWidget(
|
||||
icon: FontAwesomeIcons.squarePlus,
|
||||
text: 'Add Generics',
|
||||
),
|
||||
TextButton(onPressed: () => {signOut()}, child: const Text('Logout'))
|
||||
const Gap(16),
|
||||
MenuWidget(
|
||||
icon: FontAwesomeIcons.squarePlus,
|
||||
text: 'Add Stock',
|
||||
),
|
||||
const Gap(16),
|
||||
MenuWidget(
|
||||
icon: FontAwesomeIcons.squarePlus,
|
||||
text: 'Add Medicine Type',
|
||||
),
|
||||
const Gap(32),
|
||||
MenuWidget(
|
||||
icon: FontAwesomeIcons.listCheck,
|
||||
text: 'List of Stocks',
|
||||
),
|
||||
const Gap(32),
|
||||
// TextButton(onPressed: () => {_signOut()}, child: const Text('Logout')),
|
||||
ButtonWidget(
|
||||
text: 'Logout',
|
||||
onPressed: signOut,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue