UX update to add thene class and apply the theme to entire app
This commit is contained in:
@@ -2,7 +2,10 @@ import 'package:flutter/material.dart';
|
||||
import 'package:patient_manager/components/homeTileGrid.dart';
|
||||
import 'package:patient_manager/components/myAppBar.dart';
|
||||
import 'package:patient_manager/components/homeAppDrawer.dart';
|
||||
//import 'package:patient_manager/components/myErrorMessage.dart';
|
||||
//import 'package:patient_manager/components/mySuccessMessage.dart';
|
||||
import 'package:patient_manager/main.dart';
|
||||
//import 'package:patient_manager/theme/mihTheme.dart';
|
||||
|
||||
class Home extends StatefulWidget {
|
||||
//final String userEmail;
|
||||
@@ -42,6 +45,32 @@ class _HomeState extends State<Home> {
|
||||
body: HomeTileGrid(
|
||||
userEmail: useremail,
|
||||
),
|
||||
// floatingActionButtonLocation: FloatingActionButtonLocation.endTop,
|
||||
// floatingActionButton: Padding(
|
||||
// padding: const EdgeInsets.only(top: 65, right: 5),
|
||||
// child: FloatingActionButton.extended(
|
||||
// label: Text(
|
||||
// "Add Patient",
|
||||
// style: TextStyle(
|
||||
// fontWeight: FontWeight.bold,
|
||||
// color: MyTheme().primaryColor(),
|
||||
// ),
|
||||
// ),
|
||||
// //backgroundColor: Colors.blueAccent,
|
||||
// onPressed: () {
|
||||
// showDatePicker(
|
||||
// context: context,
|
||||
// initialDate: DateTime.now(),
|
||||
// firstDate: DateTime(2000),
|
||||
// lastDate: DateTime(2100),
|
||||
// );
|
||||
// },
|
||||
// icon: Icon(
|
||||
// Icons.add,
|
||||
// color: MyTheme().primaryColor(),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
);
|
||||
} else {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
|
||||
@@ -7,6 +7,7 @@ import 'package:patient_manager/components/mySuccessMessage.dart';
|
||||
import 'package:patient_manager/components/myTextInput.dart';
|
||||
import 'package:patient_manager/components/mybutton.dart';
|
||||
import 'package:patient_manager/objects/appUser.dart';
|
||||
import 'package:patient_manager/theme/mihTheme.dart';
|
||||
import '../components/myAppBar.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
|
||||
@@ -176,13 +177,13 @@ class _AddPatientState extends State<AddPatient> {
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
const Text(
|
||||
Text(
|
||||
"Personal Details",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 25.0,
|
||||
//color: Colors.blueAccent,
|
||||
color: MyTheme().secondaryColor(),
|
||||
),
|
||||
),
|
||||
Row(
|
||||
@@ -263,13 +264,13 @@ class _AddPatientState extends State<AddPatient> {
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 15.0),
|
||||
const Text(
|
||||
Text(
|
||||
"Medical Aid Details",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 25.0,
|
||||
//color: Colors.blueAccent,
|
||||
color: MyTheme().secondaryColor(),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
@@ -377,8 +378,8 @@ class _AddPatientState extends State<AddPatient> {
|
||||
}
|
||||
},
|
||||
buttonText: "Add",
|
||||
buttonColor: Colors.blueAccent,
|
||||
textColor: Colors.white,
|
||||
buttonColor: MyTheme().secondaryColor(),
|
||||
textColor: MyTheme().primaryColor(),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -7,6 +7,7 @@ import 'package:patient_manager/components/mySuccessMessage.dart';
|
||||
import 'package:patient_manager/components/myTextInput.dart';
|
||||
import 'package:patient_manager/components/mybutton.dart';
|
||||
import 'package:patient_manager/objects/appUser.dart';
|
||||
import 'package:patient_manager/theme/mihTheme.dart';
|
||||
import 'package:supabase_flutter/supabase_flutter.dart';
|
||||
import '../components/myAppBar.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
@@ -171,24 +172,25 @@ class _EditPatientState extends State<EditPatient> {
|
||||
width: 500.0,
|
||||
height: 475.0,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
color: MyTheme().primaryColor(),
|
||||
borderRadius: BorderRadius.circular(25.0),
|
||||
border: Border.all(color: Colors.blueAccent, width: 5.0),
|
||||
border:
|
||||
Border.all(color: MyTheme().secondaryColor(), width: 5.0),
|
||||
),
|
||||
child: Column(
|
||||
//mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
const Icon(
|
||||
Icon(
|
||||
Icons.warning_amber_rounded,
|
||||
size: 100,
|
||||
color: Colors.blueAccent,
|
||||
color: MyTheme().secondaryColor(),
|
||||
),
|
||||
const SizedBox(height: 15),
|
||||
const Text(
|
||||
Text(
|
||||
"Are you sure you want to delete this?",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Colors.blueAccent,
|
||||
color: MyTheme().secondaryColor(),
|
||||
fontSize: 25.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -198,35 +200,35 @@ class _EditPatientState extends State<EditPatient> {
|
||||
padding: const EdgeInsets.symmetric(horizontal: 25.0),
|
||||
child: Text(
|
||||
"This action is permanent! Deleting ${fnameController.text} ${lnameController.text} will remove him\\her from your account. You won't be able to recover it once it's gone.",
|
||||
style: const TextStyle(
|
||||
color: Colors.black,
|
||||
style: TextStyle(
|
||||
color: MyTheme().secondaryColor(),
|
||||
fontSize: 15.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 15),
|
||||
const Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 25.0),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 25.0),
|
||||
child: Text(
|
||||
"Here's what you'll be deleting:",
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
color: MyTheme().secondaryColor(),
|
||||
fontSize: 20.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
const Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 25.0),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 25.0),
|
||||
child: SizedBox(
|
||||
width: 450,
|
||||
child: Text(
|
||||
"1) Patient Profile Information.\n2) Patient Notes\n3) Patient Files.",
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
color: MyTheme().secondaryColor(),
|
||||
fontSize: 15.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -239,8 +241,8 @@ class _EditPatientState extends State<EditPatient> {
|
||||
child: MyButton(
|
||||
onTap: deletePatientApiCall,
|
||||
buttonText: "Delete",
|
||||
buttonColor: Colors.blueAccent,
|
||||
textColor: Colors.white,
|
||||
buttonColor: MyTheme().secondaryColor(),
|
||||
textColor: MyTheme().primaryColor(),
|
||||
))
|
||||
],
|
||||
),
|
||||
@@ -254,9 +256,9 @@ class _EditPatientState extends State<EditPatient> {
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
icon: const Icon(
|
||||
icon: Icon(
|
||||
Icons.close,
|
||||
color: Colors.red,
|
||||
color: MyTheme().errorColor(),
|
||||
size: 35,
|
||||
),
|
||||
),
|
||||
@@ -334,17 +336,18 @@ class _EditPatientState extends State<EditPatient> {
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Text(
|
||||
Text(
|
||||
"Personal Details",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 25.0,
|
||||
//color: Colors.blueAccent,
|
||||
color: MyTheme().secondaryColor(),
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
icon: const Icon(Icons.delete),
|
||||
color: MyTheme().secondaryColor(),
|
||||
alignment: Alignment.topRight,
|
||||
onPressed: () {
|
||||
deletePatientPopUp();
|
||||
@@ -430,13 +433,13 @@ class _EditPatientState extends State<EditPatient> {
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 15.0),
|
||||
const Text(
|
||||
Text(
|
||||
"Medical Aid Details",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 25.0,
|
||||
//color: Colors.blueAccent,
|
||||
color: MyTheme().secondaryColor(),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
@@ -544,8 +547,8 @@ class _EditPatientState extends State<EditPatient> {
|
||||
}
|
||||
},
|
||||
buttonText: "Update",
|
||||
buttonColor: Colors.blueAccent,
|
||||
textColor: Colors.white,
|
||||
buttonColor: MyTheme().secondaryColor(),
|
||||
textColor: MyTheme().primaryColor(),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -8,6 +8,7 @@ import 'package:http/http.dart' as http;
|
||||
import 'package:patient_manager/components/mySearchInput.dart';
|
||||
import 'package:patient_manager/components/patManAppDrawer.dart';
|
||||
import 'package:patient_manager/objects/patients.dart';
|
||||
import 'package:patient_manager/theme/mihTheme.dart';
|
||||
|
||||
class PatientManager extends StatefulWidget {
|
||||
final String userEmail;
|
||||
@@ -72,9 +73,12 @@ class _PatientManagerState extends State<PatientManager> {
|
||||
child: Container(
|
||||
height: 500,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
color: MyTheme().primaryColor(),
|
||||
borderRadius: BorderRadius.circular(25.0),
|
||||
border: Border.all(color: Colors.blueAccent, width: 3.0),
|
||||
border: Border.all(
|
||||
color: MyTheme().secondaryColor(),
|
||||
width: 3.0,
|
||||
),
|
||||
),
|
||||
child: BuildPatientsList(
|
||||
patients: patientsList,
|
||||
@@ -92,14 +96,14 @@ class _PatientManagerState extends State<PatientManager> {
|
||||
child: Container(
|
||||
height: 500,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
color: MyTheme().primaryColor(),
|
||||
borderRadius: BorderRadius.circular(25.0),
|
||||
border: Border.all(color: Colors.blueAccent, width: 3.0),
|
||||
border: Border.all(color: MyTheme().secondaryColor(), width: 3.0),
|
||||
),
|
||||
child: const Center(
|
||||
child: Center(
|
||||
child: Text(
|
||||
"Enter ID or Medical Aid No. of Patient",
|
||||
style: TextStyle(fontSize: 25, color: Colors.grey),
|
||||
style: TextStyle(fontSize: 25, color: MyTheme().messageTextColor()),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
@@ -173,21 +177,21 @@ class _PatientManagerState extends State<PatientManager> {
|
||||
floatingActionButton: Padding(
|
||||
padding: const EdgeInsets.only(top: 65, right: 5),
|
||||
child: FloatingActionButton.extended(
|
||||
label: const Text(
|
||||
label: Text(
|
||||
"Add Patient",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.white,
|
||||
color: MyTheme().primaryColor(),
|
||||
),
|
||||
),
|
||||
backgroundColor: Colors.blueAccent,
|
||||
//backgroundColor: Colors.blueAccent,
|
||||
onPressed: () {
|
||||
Navigator.of(context)
|
||||
.pushNamed('/patient-manager/add', arguments: widget.userEmail);
|
||||
},
|
||||
icon: const Icon(
|
||||
icon: Icon(
|
||||
Icons.add,
|
||||
color: Colors.white,
|
||||
color: MyTheme().primaryColor(),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -32,7 +32,7 @@ class _PatientViewState extends State<PatientView> {
|
||||
PatientNotes(
|
||||
patientIndex: widget.selectedPatient.idpatients,
|
||||
),
|
||||
SizedBox(
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
PatientFiles(
|
||||
|
||||
@@ -3,6 +3,7 @@ import 'package:patient_manager/components/myPassInput.dart';
|
||||
import 'package:patient_manager/components/myTextInput.dart';
|
||||
import 'package:patient_manager/components/mybutton.dart';
|
||||
import 'package:patient_manager/main.dart';
|
||||
import 'package:patient_manager/theme/mihTheme.dart';
|
||||
import 'package:supabase_auth_ui/supabase_auth_ui.dart';
|
||||
|
||||
class Register extends StatefulWidget {
|
||||
@@ -62,7 +63,7 @@ class _RegisterState extends State<Register> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
//backgroundColor: Colors.white,
|
||||
body: SafeArea(
|
||||
child: Center(
|
||||
child: SingleChildScrollView(
|
||||
@@ -71,20 +72,20 @@ class _RegisterState extends State<Register> {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
//logo
|
||||
const Icon(
|
||||
Icon(
|
||||
Icons.lock,
|
||||
size: 100,
|
||||
color: Colors.blueAccent,
|
||||
color: MyTheme().secondaryColor(),
|
||||
),
|
||||
//spacer
|
||||
const SizedBox(height: 10),
|
||||
//Heading
|
||||
const Text(
|
||||
Text(
|
||||
'Register',
|
||||
style: TextStyle(
|
||||
fontSize: 25,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.blueAccent,
|
||||
color: MyTheme().secondaryColor(),
|
||||
),
|
||||
),
|
||||
//spacer
|
||||
@@ -135,58 +136,44 @@ class _RegisterState extends State<Register> {
|
||||
),
|
||||
//spacer
|
||||
const SizedBox(height: 10),
|
||||
// forgot password
|
||||
const Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 25.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
Text(
|
||||
'Forgot Password?',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
//spacer
|
||||
const SizedBox(height: 30),
|
||||
// sign up button
|
||||
SizedBox(
|
||||
width: 500.0,
|
||||
height: 100.0,
|
||||
child: MyButton(
|
||||
onTap: () {},
|
||||
buttonText: "Sign Up",
|
||||
buttonColor: Colors.blueAccent,
|
||||
textColor: Colors.white,
|
||||
buttonColor: MyTheme().secondaryColor(),
|
||||
textColor: MyTheme().primaryColor(),
|
||||
),
|
||||
),
|
||||
//spacer
|
||||
const SizedBox(height: 30),
|
||||
//register text
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Text(
|
||||
'Already a User?',
|
||||
style: TextStyle(fontSize: 18, color: Colors.grey),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 6,
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: widget.onTap,
|
||||
child: const Text(
|
||||
'Sign In',
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
color: Colors.blueAccent,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
SizedBox(
|
||||
width: 450.0,
|
||||
height: 100.0,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
const Text(
|
||||
'Already a User?',
|
||||
style: TextStyle(fontSize: 18, color: Colors.grey),
|
||||
),
|
||||
)
|
||||
],
|
||||
const SizedBox(
|
||||
width: 6,
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: widget.onTap,
|
||||
child: Text(
|
||||
'Sign In',
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
color: MyTheme().secondaryColor(),
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'package:patient_manager/components/myPassInput.dart';
|
||||
import 'package:patient_manager/components/myTextInput.dart';
|
||||
import 'package:patient_manager/components/mybutton.dart';
|
||||
import 'package:patient_manager/main.dart';
|
||||
import 'package:patient_manager/theme/mihTheme.dart';
|
||||
import 'package:supabase_auth_ui/supabase_auth_ui.dart';
|
||||
|
||||
class SignIn extends StatefulWidget {
|
||||
@@ -52,7 +53,7 @@ class _SignInState extends State<SignIn> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
//backgroundColor: Colors.white,
|
||||
body: SafeArea(
|
||||
child: Center(
|
||||
child: SingleChildScrollView(
|
||||
@@ -61,20 +62,20 @@ class _SignInState extends State<SignIn> {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
//logo
|
||||
const Icon(
|
||||
Icon(
|
||||
Icons.lock,
|
||||
size: 100,
|
||||
color: Colors.blueAccent,
|
||||
color: MyTheme().secondaryColor(),
|
||||
),
|
||||
//spacer
|
||||
const SizedBox(height: 10),
|
||||
//Heading
|
||||
const Text(
|
||||
Text(
|
||||
'Sign In',
|
||||
style: TextStyle(
|
||||
fontSize: 25,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.blueAccent,
|
||||
color: MyTheme().secondaryColor(),
|
||||
),
|
||||
),
|
||||
//spacer
|
||||
@@ -107,6 +108,9 @@ class _SignInState extends State<SignIn> {
|
||||
width: 500.0,
|
||||
height: 100.0,
|
||||
child: MyButton(
|
||||
buttonText: "Sign In",
|
||||
buttonColor: MyTheme().secondaryColor(),
|
||||
textColor: MyTheme().primaryColor(),
|
||||
onTap: () {
|
||||
if (emailController.text.isEmpty ||
|
||||
passwordController.text.isEmpty) {
|
||||
@@ -125,36 +129,39 @@ class _SignInState extends State<SignIn> {
|
||||
Navigator.of(context).pushNamed('/homme');
|
||||
}
|
||||
},
|
||||
buttonText: "Sign In",
|
||||
buttonColor: Colors.blueAccent,
|
||||
textColor: Colors.white,
|
||||
),
|
||||
),
|
||||
//spacer
|
||||
const SizedBox(height: 30),
|
||||
//const SizedBox(height: 30),
|
||||
//register text
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Text(
|
||||
'New User?',
|
||||
style: TextStyle(fontSize: 18, color: Colors.grey),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 6,
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: widget.onTap,
|
||||
child: const Text(
|
||||
'Register Now',
|
||||
SizedBox(
|
||||
width: 450.0,
|
||||
height: 100.0,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
const Text(
|
||||
'New User?',
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
color: Colors.blueAccent,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
fontSize: 18,
|
||||
color: Color.fromARGB(255, 201, 200, 200)),
|
||||
),
|
||||
)
|
||||
],
|
||||
const SizedBox(
|
||||
width: 6,
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: widget.onTap,
|
||||
child: Text(
|
||||
'Register Now',
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
color: MyTheme().secondaryColor(),
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user