UX update to add thene class and apply the theme to entire app

This commit is contained in:
2024-07-09 16:51:00 +02:00
parent 8cb311e285
commit 162e37f740
38 changed files with 823 additions and 501 deletions

View File

@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:patient_manager/components/BuildFileView.dart'; import 'package:patient_manager/components/BuildFileView.dart';
import 'package:patient_manager/components/mybutton.dart'; import 'package:patient_manager/components/mybutton.dart';
import 'package:patient_manager/objects/files.dart'; import 'package:patient_manager/objects/files.dart';
import 'package:patient_manager/theme/mihTheme.dart';
//import 'dart:js' as js; //import 'dart:js' as js;
import "package:universal_html/html.dart" as html; import "package:universal_html/html.dart" as html;
@@ -22,6 +23,7 @@ class _BuildFilesListState extends State<BuildFilesList> {
void viewFilePopUp(String filename) { void viewFilePopUp(String filename) {
showDialog( showDialog(
context: context, context: context,
barrierDismissible: false,
builder: (context) => Dialog( builder: (context) => Dialog(
child: Stack( child: Stack(
children: [ children: [
@@ -30,9 +32,10 @@ class _BuildFilesListState extends State<BuildFilesList> {
width: 800.0, width: 800.0,
//height: 475.0, //height: 475.0,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: MyTheme().primaryColor(),
borderRadius: BorderRadius.circular(25.0), 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( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
@@ -40,8 +43,8 @@ class _BuildFilesListState extends State<BuildFilesList> {
Text( Text(
filename, filename,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: const TextStyle( style: TextStyle(
color: Colors.blueAccent, color: MyTheme().secondaryColor(),
fontSize: 35.0, fontSize: 35.0,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
@@ -59,8 +62,8 @@ class _BuildFilesListState extends State<BuildFilesList> {
'http://localhost:9000/mih/$filename', 'download'); 'http://localhost:9000/mih/$filename', 'download');
}, },
buttonText: "Dowload", buttonText: "Dowload",
buttonColor: Colors.blueAccent, buttonColor: MyTheme().secondaryColor(),
textColor: Colors.white, textColor: MyTheme().primaryColor(),
), ),
) )
], ],
@@ -75,9 +78,9 @@ class _BuildFilesListState extends State<BuildFilesList> {
onPressed: () { onPressed: () {
Navigator.pop(context); Navigator.pop(context);
}, },
icon: const Icon( icon: Icon(
Icons.close, Icons.close,
color: Colors.red, color: MyTheme().errorColor(),
size: 35, size: 35,
), ),
), ),
@@ -96,16 +99,29 @@ class _BuildFilesListState extends State<BuildFilesList> {
child: ListView.separated( child: ListView.separated(
shrinkWrap: true, shrinkWrap: true,
separatorBuilder: (BuildContext context, int index) { separatorBuilder: (BuildContext context, int index) {
return const Divider(); return Divider(
color: MyTheme().secondaryColor(),
);
}, },
itemCount: widget.files.length, itemCount: widget.files.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return ListTile( return ListTile(
title: Text( title: Text(
widget.files[index].file_name, widget.files[index].file_name,
style: TextStyle(
color: MyTheme().secondaryColor(),
),
),
subtitle: Text(
widget.files[index].insert_date,
style: TextStyle(
color: MyTheme().secondaryColor(),
),
),
trailing: Icon(
Icons.arrow_forward,
color: MyTheme().secondaryColor(),
), ),
subtitle: Text(widget.files[index].insert_date),
trailing: const Icon(Icons.arrow_forward),
onTap: () { onTap: () {
viewFilePopUp(widget.files[index].file_name); viewFilePopUp(widget.files[index].file_name);
}, },

View File

@@ -1,5 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:patient_manager/objects/medicine.dart'; import 'package:patient_manager/objects/medicine.dart';
import 'package:patient_manager/theme/mihTheme.dart';
class BuildMedicinesList extends StatefulWidget { class BuildMedicinesList extends StatefulWidget {
final TextEditingController contoller; final TextEditingController contoller;
@@ -24,15 +25,26 @@ class _BuildMedicinesListState extends State<BuildMedicinesList> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ListView.separated( return ListView.separated(
separatorBuilder: (BuildContext context, int index) { separatorBuilder: (BuildContext context, int index) {
return const Divider(); return Divider(
color: MyTheme().secondaryColor(),
);
}, },
itemCount: widget.medicines.length, itemCount: widget.medicines.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
//final patient = widget.patients[index].id_no.contains(widget.searchString); //final patient = widget.patients[index].id_no.contains(widget.searchString);
return ListTile( return ListTile(
title: Text(widget.medicines[index].name), title: Text(
widget.medicines[index].name,
style: TextStyle(
color: MyTheme().secondaryColor(),
),
),
subtitle: Text( subtitle: Text(
"${widget.medicines[index].unit} - ${widget.medicines[index].form}"), "${widget.medicines[index].unit} - ${widget.medicines[index].form}",
style: TextStyle(
color: MyTheme().secondaryColor(),
),
),
onTap: () { onTap: () {
setState(() { setState(() {
widget.contoller.text = widget.contoller.text =
@@ -40,7 +52,10 @@ class _BuildMedicinesListState extends State<BuildMedicinesList> {
Navigator.of(context).pop(); Navigator.of(context).pop();
}); });
}, },
trailing: const Icon(Icons.arrow_forward), trailing: Icon(
Icons.arrow_forward,
color: MyTheme().secondaryColor(),
),
); );
}, },
); );

View File

@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:patient_manager/components/myMLTextInput.dart'; import 'package:patient_manager/components/myMLTextInput.dart';
//import 'package:patient_manager/components/mybutton.dart'; //import 'package:patient_manager/components/mybutton.dart';
import 'package:patient_manager/objects/notes.dart'; import 'package:patient_manager/objects/notes.dart';
import 'package:patient_manager/theme/mihTheme.dart';
class BuildNotesList extends StatefulWidget { class BuildNotesList extends StatefulWidget {
final List<Note> notes; final List<Note> notes;
@@ -24,6 +25,7 @@ class _BuildNotesListState extends State<BuildNotesList> {
}); });
showDialog( showDialog(
context: context, context: context,
barrierDismissible: false,
builder: (context) => Dialog( builder: (context) => Dialog(
child: Stack( child: Stack(
children: [ children: [
@@ -32,9 +34,10 @@ class _BuildNotesListState extends State<BuildNotesList> {
width: 700.0, width: 700.0,
//height: 475.0, //height: 475.0,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: MyTheme().primaryColor(),
borderRadius: BorderRadius.circular(25.0), 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( child: Column(
//mainAxisSize: MainAxisSize.max, //mainAxisSize: MainAxisSize.max,
@@ -42,8 +45,8 @@ class _BuildNotesListState extends State<BuildNotesList> {
Text( Text(
title, title,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: const TextStyle( style: TextStyle(
color: Colors.blueAccent, color: MyTheme().secondaryColor(),
fontSize: 35.0, fontSize: 35.0,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
@@ -82,9 +85,9 @@ class _BuildNotesListState extends State<BuildNotesList> {
onPressed: () { onPressed: () {
Navigator.pop(context); Navigator.pop(context);
}, },
icon: const Icon( icon: Icon(
Icons.close, Icons.close,
color: Colors.red, color: MyTheme().errorColor(),
size: 35, size: 35,
), ),
), ),
@@ -103,17 +106,29 @@ class _BuildNotesListState extends State<BuildNotesList> {
child: ListView.separated( child: ListView.separated(
shrinkWrap: true, shrinkWrap: true,
separatorBuilder: (BuildContext context, int index) { separatorBuilder: (BuildContext context, int index) {
return const Divider(); return Divider(
color: MyTheme().secondaryColor(),
);
}, },
itemCount: widget.notes.length, itemCount: widget.notes.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return ListTile( return ListTile(
title: Text( title: Text(
widget.notes[index].note_name, widget.notes[index].note_name,
style: TextStyle(
color: MyTheme().secondaryColor(),
),
), ),
subtitle: Text( subtitle: Text(
"${widget.notes[index].insert_date}:\n${widget.notes[index].note_text}"), //Text(widget.notes[index].note_text), "${widget.notes[index].insert_date}:\n${widget.notes[index].note_text}",
trailing: const Icon(Icons.arrow_forward), style: TextStyle(
color: MyTheme().secondaryColor(),
),
), //Text(widget.notes[index].note_text),
trailing: Icon(
Icons.arrow_forward,
color: MyTheme().secondaryColor(),
),
onTap: () { onTap: () {
viewNotePopUp(widget.notes[index].note_name, viewNotePopUp(widget.notes[index].note_name,
"${widget.notes[index].insert_date}:\n${widget.notes[index].note_text}"); "${widget.notes[index].insert_date}:\n${widget.notes[index].note_text}");

View File

@@ -1,5 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:patient_manager/objects/patients.dart'; import 'package:patient_manager/objects/patients.dart';
import 'package:patient_manager/theme/mihTheme.dart';
class BuildPatientsList extends StatefulWidget { class BuildPatientsList extends StatefulWidget {
final List<Patient> patients; final List<Patient> patients;
@@ -21,14 +22,25 @@ class _BuildPatientsListState extends State<BuildPatientsList> {
return Row( return Row(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: [ children: [
const Icon(Icons.star_border_rounded), Icon(
Icons.star_border_rounded,
color: MyTheme().secondaryColor(),
),
Text( Text(
"${widget.patients[index].first_name} ${widget.patients[index].last_name}"), "${widget.patients[index].first_name} ${widget.patients[index].last_name}",
style: TextStyle(
color: MyTheme().secondaryColor(),
),
),
], ],
); );
} else { } else {
return Text( return Text(
"${widget.patients[index].first_name} ${widget.patients[index].last_name}"); "${widget.patients[index].first_name} ${widget.patients[index].last_name}",
style: TextStyle(
color: MyTheme().secondaryColor(),
),
);
} }
} }
@@ -36,7 +48,9 @@ class _BuildPatientsListState extends State<BuildPatientsList> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ListView.separated( return ListView.separated(
separatorBuilder: (BuildContext context, index) { separatorBuilder: (BuildContext context, index) {
return const Divider(); return Divider(
color: MyTheme().secondaryColor(),
);
}, },
itemCount: widget.patients.length, itemCount: widget.patients.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
@@ -45,14 +59,21 @@ class _BuildPatientsListState extends State<BuildPatientsList> {
return ListTile( return ListTile(
title: isMainMember(index), title: isMainMember(index),
subtitle: Text( subtitle: Text(
"ID No.: ${widget.patients[index].id_no}\nMedical Aid No.: ${widget.patients[index].medical_aid_no}"), "ID No.: ${widget.patients[index].id_no}\nMedical Aid No.: ${widget.patients[index].medical_aid_no}",
style: TextStyle(
color: MyTheme().secondaryColor(),
),
),
onTap: () { onTap: () {
setState(() { setState(() {
Navigator.of(context).pushNamed('/patient-manager/patient', Navigator.of(context).pushNamed('/patient-manager/patient',
arguments: widget.patients[index]); arguments: widget.patients[index]);
}); });
}, },
trailing: const Icon(Icons.arrow_forward), trailing: Icon(
Icons.arrow_forward,
color: MyTheme().secondaryColor(),
),
); );
}, },
); );

View File

@@ -1,5 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:patient_manager/main.dart'; import 'package:patient_manager/main.dart';
import 'package:patient_manager/theme/mihTheme.dart';
class HomeAppDrawer extends StatefulWidget { class HomeAppDrawer extends StatefulWidget {
final String userEmail; final String userEmail;
@@ -14,21 +16,31 @@ class _HomeAppDrawerState extends State<HomeAppDrawer> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Drawer( return Drawer(
backgroundColor: MyTheme().primaryColor(),
child: ListView( child: ListView(
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
children: [ children: [
DrawerHeader( DrawerHeader(
decoration: const BoxDecoration( decoration: BoxDecoration(
color: Colors.blueAccent, color: MyTheme().secondaryColor(),
),
child: Text(
widget.userEmail,
style: TextStyle(color: MyTheme().primaryColor()),
), ),
child: Text(widget.userEmail),
), ),
ListTile( ListTile(
title: const Row( title: Row(
children: [ children: [
Icon(Icons.logout), Icon(
Icons.logout,
color: MyTheme().secondaryColor(),
),
SizedBox(width: 25.0), SizedBox(width: 25.0),
Text("Sign Out"), Text(
"Sign Out",
style: TextStyle(color: MyTheme().secondaryColor()),
),
], ],
), ),
onTap: () { onTap: () {

View File

@@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:patient_manager/theme/mihTheme.dart';
class HomeTile extends StatelessWidget { class HomeTile extends StatelessWidget {
final String tileName; final String tileName;
@@ -18,30 +19,39 @@ class HomeTile extends StatelessWidget {
return GestureDetector( return GestureDetector(
onTap: onTap, onTap: onTap,
child: Card( child: Card(
color: Colors.white, color: MyTheme().secondaryColor(),
elevation: 20, elevation: 20,
child: Column( child: Column(
//mainAxisSize: MainAxisSize.min, //mainAxisSize: MainAxisSize.min,
children: [ children: [
Expanded( Expanded(
child: ListTile( child: ListTile(
leading: const Icon(Icons.abc), leading: Icon(
title: Text( Icons.abc,
tileName, color: MyTheme().primaryColor(),
style: const TextStyle(
fontWeight: FontWeight.bold,
), ),
), title: Text(
subtitle: Text(tileDescription), tileName,
), style: TextStyle(
fontWeight: FontWeight.bold,
color: MyTheme().primaryColor(),
),
),
subtitle: Text(
tileDescription,
style: TextStyle(color: MyTheme().primaryColor()),
)),
), ),
const Expanded( Expanded(
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [
Padding( Padding(
padding: EdgeInsets.symmetric(horizontal: 10), padding: const EdgeInsets.symmetric(horizontal: 10),
child: Icon(Icons.arrow_forward), child: Icon(
Icons.arrow_forward,
color: MyTheme().secondaryColor(),
),
), ),
], ],
), ),

View File

@@ -5,6 +5,7 @@ import 'package:patient_manager/components/buildMedList.dart';
import 'package:patient_manager/components/myErrorMessage.dart'; import 'package:patient_manager/components/myErrorMessage.dart';
import 'package:patient_manager/objects/medicine.dart'; import 'package:patient_manager/objects/medicine.dart';
import 'package:http/http.dart' as http; import 'package:http/http.dart' as http;
import 'package:patient_manager/theme/mihTheme.dart';
class MedicineSearch extends StatefulWidget { class MedicineSearch extends StatefulWidget {
final TextEditingController searchVlaue; final TextEditingController searchVlaue;
@@ -65,20 +66,20 @@ class _MedicineSearchState extends State<MedicineSearch> {
width: 700.0, width: 700.0,
//height: 475.0, //height: 475.0,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: MyTheme().primaryColor(),
borderRadius: BorderRadius.circular(25.0), 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( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
const Text( Text(
"Select Medicine", "Select Medicine",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
color: Colors.blueAccent, color: MyTheme().secondaryColor(),
fontSize: 35.0, fontSize: 35.0,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),

View File

@@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:patient_manager/theme/mihTheme.dart';
class MyAppBar extends StatelessWidget implements PreferredSizeWidget { class MyAppBar extends StatelessWidget implements PreferredSizeWidget {
@override @override
@@ -11,9 +12,10 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppBar( return AppBar(
backgroundColor: Colors.blueAccent, //backgroundColor: Colors.blueAccent,
elevation: 8, elevation: 8,
shadowColor: Colors.black, shadowColor: MyTheme().secondaryColor(),
iconTheme: IconThemeData(color: MyTheme().primaryColor()),
// actions: [ // actions: [
// IconButton( // IconButton(
// onPressed: () { // onPressed: () {
@@ -27,9 +29,9 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget {
// ], // ],
title: Text( title: Text(
barTitle, barTitle,
style: const TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.black, color: MyTheme().primaryColor(),
), ),
), ),
centerTitle: true, centerTitle: true,

View File

@@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:patient_manager/theme/mihTheme.dart';
class MyDateField extends StatefulWidget { class MyDateField extends StatefulWidget {
final controller; final controller;
@@ -40,20 +41,20 @@ class _MyDateFieldState extends State<MyDateField> {
return Row( return Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
const Text( Text(
"*", "*",
style: TextStyle(color: Colors.red), style: TextStyle(color: MyTheme().errorColor()),
), ),
const SizedBox( const SizedBox(
width: 8.0, width: 8.0,
), ),
Text(widget.LableText, Text(widget.LableText,
style: const TextStyle(color: Colors.blueAccent)), style: TextStyle(color: MyTheme().secondaryColor())),
], ],
); );
} else { } else {
return Text(widget.LableText, return Text(widget.LableText,
style: const TextStyle(color: Colors.blueAccent)); style: TextStyle(color: MyTheme().secondaryColor()));
} }
} }
@@ -88,6 +89,7 @@ class _MyDateFieldState extends State<MyDateField> {
return Padding( return Padding(
padding: const EdgeInsets.symmetric(horizontal: 25.0), padding: const EdgeInsets.symmetric(horizontal: 25.0),
child: TextField( child: TextField(
style: TextStyle(color: MyTheme().secondaryColor()),
controller: widget.controller, controller: widget.controller,
readOnly: true, readOnly: true,
obscureText: false, obscureText: false,
@@ -97,25 +99,39 @@ class _MyDateFieldState extends State<MyDateField> {
}), }),
decoration: InputDecoration( decoration: InputDecoration(
errorText: _errorText, errorText: _errorText,
errorStyle: TextStyle(
color: MyTheme().errorColor(), fontWeight: FontWeight.bold),
label: setRequiredText(), label: setRequiredText(),
//labelText: widget.LableText, //labelText: widget.LableText,
//labelStyle: const TextStyle(color: Colors.blueAccent), //labelStyle: const TextStyle(color: Colors.blueAccent),
prefixIcon: const Icon( prefixIcon: Icon(
Icons.calendar_today, Icons.calendar_today,
color: Colors.blueAccent, color: MyTheme().secondaryColor(),
), ),
fillColor: Colors.white, fillColor: MyTheme().primaryColor(),
filled: true, filled: true,
//hintText: hintText, //hintText: hintText,
hintStyle: TextStyle(color: Colors.blueGrey[400]), //hintStyle: TextStyle(color: Colors.blueGrey[400]),
enabledBorder: const OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(
color: Colors.blueAccent, color: MyTheme().secondaryColor(),
width: 2.0, width: 2.0,
), ),
), ),
focusedBorder: const OutlineInputBorder( focusedErrorBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.blue), borderSide: BorderSide(
color: MyTheme().errorColor(),
width: 2.0,
),
),
errorBorder: OutlineInputBorder(
borderSide: BorderSide(
color: MyTheme().errorColor(),
width: 2.0,
),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: MyTheme().secondaryColor()),
), ),
), ),
onTap: () { onTap: () {

View File

@@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:patient_manager/theme/mihTheme.dart';
class MyDropdownField extends StatefulWidget { class MyDropdownField extends StatefulWidget {
final TextEditingController controller; final TextEditingController controller;
@@ -32,20 +33,20 @@ class _MyDropdownFieldState extends State<MyDropdownField> {
return Row( return Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
const Text( Text(
"*", "*",
style: TextStyle(color: Colors.red), style: TextStyle(color: MyTheme().errorColor()),
), ),
const SizedBox( const SizedBox(
width: 8.0, width: 8.0,
), ),
Text(widget.hintText, Text(widget.hintText,
style: const TextStyle(color: Colors.blueAccent)), style: TextStyle(color: MyTheme().secondaryColor())),
], ],
); );
} else { } else {
return Text(widget.hintText, return Text(widget.hintText,
style: const TextStyle(color: Colors.blueAccent)); style: TextStyle(color: MyTheme().secondaryColor()));
} }
} }
@@ -72,7 +73,12 @@ class _MyDropdownFieldState extends State<MyDropdownField> {
List<DropdownMenuEntry<String>> buidMenueOptions(List<String> options) { List<DropdownMenuEntry<String>> buidMenueOptions(List<String> options) {
List<DropdownMenuEntry<String>> menueList = []; List<DropdownMenuEntry<String>> menueList = [];
for (final i in options) { for (final i in options) {
menueList.add(DropdownMenuEntry(value: i, label: i)); menueList.add(DropdownMenuEntry(
value: i,
label: i,
style: ButtonStyle(
foregroundColor:
WidgetStatePropertyAll(MyTheme().secondaryColor()))));
} }
return menueList; return menueList;
} }
@@ -90,12 +96,21 @@ class _MyDropdownFieldState extends State<MyDropdownField> {
return Padding( return Padding(
padding: const EdgeInsets.symmetric(horizontal: 25.0), padding: const EdgeInsets.symmetric(horizontal: 25.0),
child: DropdownMenu( child: DropdownMenu(
//onSelected: widget.onSelect, trailingIcon: Icon(
Icons.arrow_drop_down,
color: MyTheme().secondaryColor(),
),
selectedTrailingIcon: Icon(
Icons.arrow_drop_up,
color: MyTheme().secondaryColor(),
),
textStyle: TextStyle(color: MyTheme().secondaryColor()),
menuHeight: 300, menuHeight: 300,
controller: widget.controller, controller: widget.controller,
expandedInsets: EdgeInsets.zero, expandedInsets: EdgeInsets.zero,
label: setRequiredText(), label: setRequiredText(),
errorText: _errorText, errorText: _errorText,
focusNode: _focus, focusNode: _focus,
onSelected: (_) => setState(() { onSelected: (_) => setState(() {
startup = false; startup = false;
@@ -107,27 +122,44 @@ class _MyDropdownFieldState extends State<MyDropdownField> {
}); });
widget.controller.clear(); widget.controller.clear();
}, },
icon: const Icon( icon: Icon(
Icons.delete_outline_rounded, Icons.delete_outline_rounded,
color: Colors.blueAccent, color: MyTheme().secondaryColor(),
), ),
), ),
menuStyle: const MenuStyle( menuStyle: MenuStyle(
backgroundColor: WidgetStatePropertyAll(Colors.white), backgroundColor: WidgetStatePropertyAll(MyTheme().primaryColor()),
side: WidgetStatePropertyAll( side: WidgetStatePropertyAll(
BorderSide(color: Colors.blueAccent, width: 2.0), BorderSide(color: MyTheme().secondaryColor(), width: 2.0),
), ),
), ),
inputDecorationTheme: const InputDecorationTheme(
inputDecorationTheme: InputDecorationTheme(
filled: true, filled: true,
fillColor: Colors.white, errorStyle: TextStyle(
enabledBorder: OutlineInputBorder( color: MyTheme().errorColor(), fontWeight: FontWeight.bold),
fillColor: MyTheme().primaryColor(),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: MyTheme().secondaryColor())),
focusedErrorBorder: OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(
color: Colors.blueAccent, color: MyTheme().errorColor(),
width: 2.0, width: 2.0,
), ),
), ),
outlineBorder: BorderSide(color: Colors.blue), errorBorder: OutlineInputBorder(
borderSide: BorderSide(
color: MyTheme().errorColor(),
width: 2.0,
),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: MyTheme().secondaryColor(),
width: 2.0,
),
),
outlineBorder: BorderSide(color: MyTheme().secondaryColor()),
), ),
dropdownMenuEntries: menu, dropdownMenuEntries: menu,
// const <DropdownMenuEntry<String>>[ // const <DropdownMenuEntry<String>>[

View File

@@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:patient_manager/theme/mihTheme.dart';
class MyErrorMessage extends StatefulWidget { class MyErrorMessage extends StatefulWidget {
final String errorType; final String errorType;
@@ -22,35 +23,35 @@ class _MyErrorMessageState extends State<MyErrorMessage> {
width: 500.0, width: 500.0,
height: 375.0, height: 375.0,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: MyTheme().primaryColor(),
borderRadius: BorderRadius.circular(25.0), borderRadius: BorderRadius.circular(25.0),
border: Border.all(color: Colors.red, width: 5.0), border: Border.all(color: MyTheme().errorColor(), width: 5.0),
), ),
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
const Icon( Icon(
Icons.warning_amber_rounded, Icons.warning_amber_rounded,
size: 100, size: 100,
color: Colors.red, color: MyTheme().errorColor(),
), ),
const SizedBox(height: 15), const SizedBox(height: 15),
const Text( Text(
"Oops! Looks like some fields are missing.", "Oops! Looks like some fields are missing.",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
color: Colors.red, color: MyTheme().errorColor(),
fontSize: 25.0, fontSize: 25.0,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
), ),
const SizedBox(height: 10), const SizedBox(height: 10),
const Padding( Padding(
padding: EdgeInsets.symmetric(horizontal: 25.0), padding: const EdgeInsets.symmetric(horizontal: 25.0),
child: Text( child: Text(
"We noticed that some required fields are still empty. To ensure your request is processed smoothly, please fill out all the highlighted fields before submitting the form again.", "We noticed that some required fields are still empty. To ensure your request is processed smoothly, please fill out all the highlighted fields before submitting the form again.",
style: TextStyle( style: TextStyle(
color: Colors.black, color: MyTheme().secondaryColor(),
fontSize: 15.0, fontSize: 15.0,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
@@ -60,9 +61,9 @@ class _MyErrorMessageState extends State<MyErrorMessage> {
Padding( Padding(
padding: const EdgeInsets.symmetric(horizontal: 25.0), padding: const EdgeInsets.symmetric(horizontal: 25.0),
child: RichText( child: RichText(
text: const TextSpan( text: TextSpan(
style: TextStyle( style: TextStyle(
color: Colors.black, color: MyTheme().secondaryColor(),
fontSize: 15.0, fontSize: 15.0,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
@@ -70,10 +71,15 @@ class _MyErrorMessageState extends State<MyErrorMessage> {
TextSpan( TextSpan(
text: "Here's a quick tip: ", text: "Here's a quick tip: ",
style: TextStyle( style: TextStyle(
fontStyle: FontStyle.italic, color: Colors.red)), fontStyle: FontStyle.italic,
TextSpan(text: "Look for fields with an asterisk ("), color: MyTheme().errorColor())),
TextSpan(text: "*", style: TextStyle(color: Colors.red)), const TextSpan(
TextSpan(text: ") next to them, as these are mandatory."), text: "Look for fields with an asterisk ("),
TextSpan(
text: "*",
style: TextStyle(color: MyTheme().errorColor())),
const TextSpan(
text: ") next to them, as these are mandatory."),
], ],
), ),
), ),
@@ -90,9 +96,9 @@ class _MyErrorMessageState extends State<MyErrorMessage> {
onPressed: () { onPressed: () {
Navigator.pop(context); Navigator.pop(context);
}, },
icon: const Icon( icon: Icon(
Icons.close, Icons.close,
color: Colors.red, color: MyTheme().errorColor(),
size: 35, size: 35,
), ),
), ),
@@ -109,60 +115,60 @@ class _MyErrorMessageState extends State<MyErrorMessage> {
width: 500.0, width: 500.0,
height: 450.0, height: 450.0,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: MyTheme().primaryColor(),
borderRadius: BorderRadius.circular(25.0), borderRadius: BorderRadius.circular(25.0),
border: Border.all(color: Colors.red, width: 5.0), border: Border.all(color: MyTheme().errorColor(), width: 5.0),
), ),
child: const Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
Icon( Icon(
Icons.warning_amber_rounded, Icons.warning_amber_rounded,
size: 100, size: 100,
color: Colors.red, color: MyTheme().errorColor(),
), ),
SizedBox(height: 15), SizedBox(height: 15),
Text( Text(
"Uh oh! Login attempt unsuccessful.", "Uh oh! Login attempt unsuccessful.",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
color: Colors.red, color: MyTheme().errorColor(),
fontSize: 25.0, fontSize: 25.0,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
), ),
SizedBox(height: 10), const SizedBox(height: 10),
Padding( Padding(
padding: EdgeInsets.symmetric(horizontal: 25.0), padding: EdgeInsets.symmetric(horizontal: 25.0),
child: Text( child: Text(
"The email address or password you entered doesn't seem to match our records. Please double-check your information and try again.", "The email address or password you entered doesn't seem to match our records. Please double-check your information and try again.",
style: TextStyle( style: TextStyle(
color: Colors.black, color: MyTheme().secondaryColor(),
fontSize: 15.0, fontSize: 15.0,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
), ),
), ),
SizedBox(height: 15), const SizedBox(height: 15),
Padding( Padding(
padding: EdgeInsets.symmetric(horizontal: 25.0), padding: EdgeInsets.symmetric(horizontal: 25.0),
child: Text( child: Text(
"Here are some things to keep in mind:", "Here are some things to keep in mind:",
style: TextStyle( style: TextStyle(
color: Colors.black, color: MyTheme().secondaryColor(),
fontSize: 20.0, fontSize: 20.0,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
), ),
), ),
SizedBox(height: 10), const SizedBox(height: 10),
Padding( Padding(
padding: EdgeInsets.symmetric(horizontal: 25.0), padding: EdgeInsets.symmetric(horizontal: 25.0),
child: Text( child: Text(
"1) Are you sure you're using the correct email address associated with your account?\n2) Is your caps lock key on? Passwords are case-sensitive.\n3) If you've forgotten your password, no worries! Click on \"Forgot Password?\" to reset it.", "1) Are you sure you're using the correct email address associated with your account?\n2) Is your caps lock key on? Passwords are case-sensitive.\n3) If you've forgotten your password, no worries! Click on \"Forgot Password?\" to reset it.",
textAlign: TextAlign.left, textAlign: TextAlign.left,
style: TextStyle( style: TextStyle(
color: Colors.black, color: MyTheme().secondaryColor(),
fontSize: 15.0, fontSize: 15.0,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
@@ -180,9 +186,9 @@ class _MyErrorMessageState extends State<MyErrorMessage> {
onPressed: () { onPressed: () {
Navigator.pop(context); Navigator.pop(context);
}, },
icon: const Icon( icon: Icon(
Icons.close, Icons.close,
color: Colors.red, color: MyTheme().errorColor(),
size: 35, size: 35,
), ),
), ),
@@ -199,60 +205,60 @@ class _MyErrorMessageState extends State<MyErrorMessage> {
width: 500.0, width: 500.0,
height: 450.0, height: 450.0,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: MyTheme().primaryColor(),
borderRadius: BorderRadius.circular(25.0), borderRadius: BorderRadius.circular(25.0),
border: Border.all(color: Colors.red, width: 5.0), border: Border.all(color: MyTheme().errorColor(), width: 5.0),
), ),
child: const Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
Icon( Icon(
Icons.warning_amber_rounded, Icons.warning_amber_rounded,
size: 100, size: 100,
color: Colors.red, color: MyTheme().errorColor(),
), ),
SizedBox(height: 15), const SizedBox(height: 15),
Text( Text(
"Internet Connection Lost!", "Internet Connection Lost!",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
color: Colors.red, color: MyTheme().errorColor(),
fontSize: 25.0, fontSize: 25.0,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
), ),
SizedBox(height: 10), const SizedBox(height: 10),
Padding( Padding(
padding: EdgeInsets.symmetric(horizontal: 25.0), padding: EdgeInsets.symmetric(horizontal: 25.0),
child: Text( child: Text(
"We seem to be having some trouble connecting you to the internet. This could be due to a temporary outage or an issue with your device's connection.", "We seem to be having some trouble connecting you to the internet. This could be due to a temporary outage or an issue with your device's connection.",
style: TextStyle( style: TextStyle(
color: Colors.black, color: MyTheme().secondaryColor(),
fontSize: 15.0, fontSize: 15.0,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
), ),
), ),
SizedBox(height: 15), const SizedBox(height: 15),
Padding( Padding(
padding: EdgeInsets.symmetric(horizontal: 25.0), padding: EdgeInsets.symmetric(horizontal: 25.0),
child: Text( child: Text(
"Here are a few things you can try:", "Here are a few things you can try:",
style: TextStyle( style: TextStyle(
color: Colors.black, color: MyTheme().secondaryColor(),
fontSize: 20.0, fontSize: 20.0,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
), ),
), ),
SizedBox(height: 10), const SizedBox(height: 10),
Padding( Padding(
padding: EdgeInsets.symmetric(horizontal: 25.0), padding: EdgeInsets.symmetric(horizontal: 25.0),
child: Text( child: Text(
"1) Check your Wi-Fi signal strength or try connecting to a different network.\n2) Restart your device (computer, phone, etc.) and your router/modem.\n3) If you're using cellular data, ensure you have a strong signal and haven't reached your data limit.", "1) Check your Wi-Fi signal strength or try connecting to a different network.\n2) Restart your device (computer, phone, etc.) and your router/modem.\n3) If you're using cellular data, ensure you have a strong signal and haven't reached your data limit.",
textAlign: TextAlign.left, textAlign: TextAlign.left,
style: TextStyle( style: TextStyle(
color: Colors.black, color: MyTheme().secondaryColor(),
fontSize: 15.0, fontSize: 15.0,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
@@ -270,9 +276,9 @@ class _MyErrorMessageState extends State<MyErrorMessage> {
onPressed: () { onPressed: () {
Navigator.pop(context); Navigator.pop(context);
}, },
icon: const Icon( icon: Icon(
Icons.close, Icons.close,
color: Colors.red, color: MyTheme().errorColor(),
size: 35, size: 35,
), ),
), ),

View File

@@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:patient_manager/theme/mihTheme.dart';
class MyMLTextField extends StatefulWidget { class MyMLTextField extends StatefulWidget {
final controller; final controller;
@@ -55,20 +56,20 @@ class _MyMLTextFieldState extends State<MyMLTextField> {
return Row( return Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
const Text( Text(
"*", "*",
style: TextStyle(color: Colors.red), style: TextStyle(color: MyTheme().errorColor()),
), ),
const SizedBox( const SizedBox(
width: 8.0, width: 8.0,
), ),
Text(widget.hintText, Text(widget.hintText,
style: const TextStyle(color: Colors.blueAccent)), style: TextStyle(color: MyTheme().secondaryColor())),
], ],
); );
} else { } else {
return Text(widget.hintText, return Text(widget.hintText,
style: const TextStyle(color: Colors.blueAccent)); style: TextStyle(color: MyTheme().secondaryColor()));
} }
} }
@@ -83,6 +84,7 @@ class _MyMLTextFieldState extends State<MyMLTextField> {
return Padding( return Padding(
padding: const EdgeInsets.symmetric(horizontal: 25.0), padding: const EdgeInsets.symmetric(horizontal: 25.0),
child: TextField( child: TextField(
style: TextStyle(color: MyTheme().secondaryColor()),
textAlign: TextAlign.start, textAlign: TextAlign.start,
textAlignVertical: TextAlignVertical.top, textAlignVertical: TextAlignVertical.top,
expands: true, expands: true,
@@ -97,20 +99,34 @@ class _MyMLTextFieldState extends State<MyMLTextField> {
decoration: InputDecoration( decoration: InputDecoration(
label: setRequiredText(), label: setRequiredText(),
errorText: _errorText, errorText: _errorText,
labelStyle: const TextStyle(color: Colors.blueAccent), errorStyle: TextStyle(
color: MyTheme().errorColor(), fontWeight: FontWeight.bold),
labelStyle: TextStyle(color: MyTheme().secondaryColor()),
alignLabelWithHint: true, alignLabelWithHint: true,
fillColor: Colors.white, fillColor: MyTheme().primaryColor(),
filled: true, filled: true,
//hintText: hintText, //hintText: hintText,
//hintStyle: TextStyle(color: Colors.blueGrey[400]), //hintStyle: TextStyle(color: Colors.blueGrey[400]),
enabledBorder: const OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(
color: Colors.blueAccent, color: MyTheme().secondaryColor(),
width: 2.0, width: 2.0,
), ),
), ),
focusedBorder: const OutlineInputBorder( focusedErrorBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.blue), borderSide: BorderSide(
color: MyTheme().errorColor(),
width: 2.0,
),
),
errorBorder: OutlineInputBorder(
borderSide: BorderSide(
color: MyTheme().errorColor(),
width: 2.0,
),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: MyTheme().secondaryColor()),
), ),
), ),
), ),

View File

@@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:patient_manager/theme/mihTheme.dart';
class MyPassField extends StatefulWidget { class MyPassField extends StatefulWidget {
final controller; final controller;
@@ -51,20 +52,20 @@ class _MyPassFieldState extends State<MyPassField> {
return Row( return Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
const Text( Text(
"*", "*",
style: TextStyle(color: Colors.red), style: TextStyle(color: MyTheme().errorColor()),
), ),
const SizedBox( const SizedBox(
width: 8.0, width: 8.0,
), ),
Text(widget.hintText, Text(widget.hintText,
style: const TextStyle(color: Colors.blueAccent)), style: TextStyle(color: MyTheme().secondaryColor())),
], ],
); );
} else { } else {
return Text(widget.hintText, return Text(widget.hintText,
style: const TextStyle(color: Colors.blueAccent)); style: TextStyle(color: MyTheme().secondaryColor()));
} }
} }
@@ -86,27 +87,42 @@ class _MyPassFieldState extends State<MyPassField> {
padding: const EdgeInsets.symmetric(horizontal: 25.0), padding: const EdgeInsets.symmetric(horizontal: 25.0),
child: TextField( child: TextField(
controller: widget.controller, controller: widget.controller,
style: TextStyle(color: MyTheme().secondaryColor()),
obscureText: _obscured, obscureText: _obscured,
focusNode: textFieldFocusNode, focusNode: textFieldFocusNode,
onChanged: (_) => setState(() { onChanged: (_) => setState(() {
startup = false; startup = false;
}), }),
decoration: InputDecoration( decoration: InputDecoration(
fillColor: Colors.white, fillColor: MyTheme().primaryColor(),
filled: true, filled: true,
label: setRequiredText(), label: setRequiredText(),
//labelStyle: const TextStyle(color: Colors.blueAccent), //labelStyle: const TextStyle(color: Colors.blueAccent),
errorText: _errorText, errorText: _errorText,
errorStyle: TextStyle(
color: MyTheme().errorColor(), fontWeight: FontWeight.bold),
//hintText: widget.hintText, //hintText: widget.hintText,
//hintStyle: TextStyle(color: Colors.blueGrey[400]), //hintStyle: TextStyle(color: Colors.blueGrey[400]),
enabledBorder: const OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(
color: Colors.blueAccent, color: MyTheme().secondaryColor(),
width: 2.0, width: 2.0,
), ),
), ),
focusedBorder: const OutlineInputBorder( focusedErrorBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.blue), borderSide: BorderSide(
color: MyTheme().errorColor(),
width: 2.0,
),
),
errorBorder: OutlineInputBorder(
borderSide: BorderSide(
color: MyTheme().errorColor(),
width: 2.0,
),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: MyTheme().secondaryColor()),
), ),
suffixIcon: Padding( suffixIcon: Padding(
padding: const EdgeInsets.fromLTRB(0, 0, 4, 0), padding: const EdgeInsets.fromLTRB(0, 0, 4, 0),
@@ -117,7 +133,7 @@ class _MyPassFieldState extends State<MyPassField> {
? Icons.visibility_rounded ? Icons.visibility_rounded
: Icons.visibility_off_rounded, : Icons.visibility_off_rounded,
size: 24, size: 24,
color: Colors.blue, color: MyTheme().secondaryColor(),
), ),
), ),
), ),

View File

@@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:patient_manager/theme/mihTheme.dart';
class MySearchField extends StatefulWidget { class MySearchField extends StatefulWidget {
final TextEditingController controller; final TextEditingController controller;
@@ -59,20 +60,24 @@ class _MySearchFieldState extends State<MySearchField> {
return Row( return Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
const Text( Text(
"*", "*",
style: TextStyle(color: Colors.red), style: TextStyle(color: MyTheme().errorColor()),
), ),
const SizedBox( const SizedBox(
width: 8.0, width: 8.0,
), ),
Text(widget.hintText, Text(
style: const TextStyle(color: Colors.blueAccent)), widget.hintText,
style: TextStyle(
color: MyTheme().secondaryColor(),
),
),
], ],
); );
} else { } else {
return Text(widget.hintText, return Text(widget.hintText,
style: const TextStyle(color: Colors.blueAccent)); style: TextStyle(color: MyTheme().secondaryColor()));
} }
} }
@@ -87,17 +92,19 @@ class _MySearchFieldState extends State<MySearchField> {
return Padding( return Padding(
padding: const EdgeInsets.symmetric(horizontal: 25.0), padding: const EdgeInsets.symmetric(horizontal: 25.0),
child: TextField( child: TextField(
style: TextStyle(color: MyTheme().secondaryColor()),
onChanged: widget.onChanged, onChanged: widget.onChanged,
controller: widget.controller, controller: widget.controller,
//style: TextStyle(color: MyTheme().secondaryColor()),
readOnly: makeEditable(), readOnly: makeEditable(),
focusNode: _focus, focusNode: _focus,
obscureText: false, obscureText: false,
decoration: InputDecoration( decoration: InputDecoration(
fillColor: Colors.white, fillColor: MyTheme().primaryColor(),
prefixIcon: IconButton( prefixIcon: IconButton(
icon: const Icon( icon: Icon(
Icons.search, Icons.search,
color: Colors.blueAccent, color: MyTheme().secondaryColor(),
), ),
onPressed: () { onPressed: () {
setState(() { setState(() {
@@ -111,14 +118,28 @@ class _MySearchFieldState extends State<MySearchField> {
filled: true, filled: true,
label: setRequiredText(), label: setRequiredText(),
errorText: _errorText, errorText: _errorText,
enabledBorder: const OutlineInputBorder( errorStyle: TextStyle(
color: MyTheme().errorColor(), fontWeight: FontWeight.bold),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(
color: Colors.blueAccent, color: MyTheme().secondaryColor(),
width: 2.0, width: 2.0,
), ),
), ),
focusedBorder: const OutlineInputBorder( focusedErrorBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.blue), borderSide: BorderSide(
color: MyTheme().errorColor(),
width: 2.0,
),
),
errorBorder: OutlineInputBorder(
borderSide: BorderSide(
color: MyTheme().errorColor(),
width: 2.0,
),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: MyTheme().secondaryColor()),
), ),
), ),
), ),

View File

@@ -1,5 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:patient_manager/components/mybutton.dart'; import 'package:patient_manager/components/mybutton.dart';
import 'package:patient_manager/theme/mihTheme.dart';
class MySuccessMessage extends StatefulWidget { class MySuccessMessage extends StatefulWidget {
final String successType; final String successType;
@@ -26,24 +27,24 @@ class _MySuccessMessageState extends State<MySuccessMessage> {
width: 500.0, width: 500.0,
// height: 375.0, // height: 375.0,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: MyTheme().primaryColor(),
borderRadius: BorderRadius.circular(25.0), borderRadius: BorderRadius.circular(25.0),
border: Border.all(color: Colors.green, width: 5.0), border: Border.all(color: MyTheme().successColor(), width: 5.0),
), ),
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
const Icon( Icon(
Icons.check_circle_outline_rounded, Icons.check_circle_outline_rounded,
size: 100, size: 100,
color: Colors.green, color: MyTheme().successColor(),
), ),
const SizedBox(height: 15), const SizedBox(height: 15),
const Text( Text(
"Success!", "Success!",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
color: Colors.green, color: MyTheme().successColor(),
fontSize: 25.0, fontSize: 25.0,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
@@ -53,8 +54,8 @@ class _MySuccessMessageState extends State<MySuccessMessage> {
padding: const EdgeInsets.symmetric(horizontal: 25.0), padding: const EdgeInsets.symmetric(horizontal: 25.0),
child: Text( child: Text(
message, message,
style: const TextStyle( style: TextStyle(
color: Colors.black, color: MyTheme().secondaryColor(),
fontSize: 15.0, fontSize: 15.0,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
@@ -69,8 +70,8 @@ class _MySuccessMessageState extends State<MySuccessMessage> {
Navigator.pop(context); Navigator.pop(context);
}, },
buttonText: "Dismiss", buttonText: "Dismiss",
buttonColor: Colors.green, buttonColor: MyTheme().successColor(),
textColor: Colors.white, textColor: MyTheme().primaryColor(),
), ),
), ),
], ],

View File

@@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:patient_manager/theme/mihTheme.dart';
class MyTextField extends StatefulWidget { class MyTextField extends StatefulWidget {
final controller; final controller;
@@ -55,20 +56,20 @@ class _MyTextFieldState extends State<MyTextField> {
return Row( return Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
const Text( Text(
"*", "*",
style: TextStyle(color: Colors.red), style: TextStyle(color: MyTheme().errorColor()),
), ),
const SizedBox( const SizedBox(
width: 8.0, width: 8.0,
), ),
Text(widget.hintText, Text(widget.hintText,
style: const TextStyle(color: Colors.blueAccent)), style: TextStyle(color: MyTheme().secondaryColor())),
], ],
); );
} else { } else {
return Text(widget.hintText, return Text(widget.hintText,
style: const TextStyle(color: Colors.blueAccent)); style: TextStyle(color: MyTheme().secondaryColor()));
} }
} }
@@ -83,6 +84,7 @@ class _MyTextFieldState extends State<MyTextField> {
return Padding( return Padding(
padding: const EdgeInsets.symmetric(horizontal: 25.0), padding: const EdgeInsets.symmetric(horizontal: 25.0),
child: TextField( child: TextField(
style: TextStyle(color: MyTheme().secondaryColor()),
controller: widget.controller, controller: widget.controller,
focusNode: _focus, focusNode: _focus,
readOnly: makeEditable(), readOnly: makeEditable(),
@@ -92,20 +94,35 @@ class _MyTextFieldState extends State<MyTextField> {
}), }),
decoration: InputDecoration( decoration: InputDecoration(
label: setRequiredText(), label: setRequiredText(),
//labelStyle: const TextStyle(color: Colors.blueAccent), //labelStyle: TextStyle(color: MyTheme().primaryColor()),
fillColor: Colors.white, fillColor: MyTheme().primaryColor(),
filled: true, filled: true,
errorText: _errorText, errorText: _errorText,
errorStyle: TextStyle(
color: MyTheme().errorColor(), fontWeight: FontWeight.bold),
//errorBorder: const InputBorder(),
//hintText: hintText, //hintText: hintText,
//hintStyle: TextStyle(color: Colors.blueGrey[400]), //hintStyle: TextStyle(color: Colors.blueGrey[400]),
enabledBorder: const OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(
color: Colors.blueAccent, color: MyTheme().secondaryColor(),
width: 2.0, width: 2.0,
), ),
), ),
focusedBorder: const OutlineInputBorder( focusedErrorBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.blue), borderSide: BorderSide(
color: MyTheme().errorColor(),
width: 2.0,
),
),
errorBorder: OutlineInputBorder(
borderSide: BorderSide(
color: MyTheme().errorColor(),
width: 2.0,
),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: MyTheme().secondaryColor()),
), ),
), ),
), ),

View File

@@ -32,6 +32,7 @@ class MyButton extends StatelessWidget {
//fontWeight: FontWeight.bold, //fontWeight: FontWeight.bold,
fontSize: 20, fontSize: 20,
color: textColor, color: textColor,
fontWeight: FontWeight.bold,
), ),
), ),
), ),

View File

@@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
import 'package:patient_manager/main.dart'; import 'package:patient_manager/main.dart';
import 'package:http/http.dart' as http; import 'package:http/http.dart' as http;
import 'package:patient_manager/objects/appUser.dart'; import 'package:patient_manager/objects/appUser.dart';
import 'package:patient_manager/theme/mihTheme.dart';
class PatManAppDrawer extends StatefulWidget { class PatManAppDrawer extends StatefulWidget {
final String userEmail; final String userEmail;
@@ -22,8 +23,8 @@ class _PatManAppDrawerState extends State<PatManAppDrawer> {
//print("pat man drawer: " + endpointUserData + widget.userEmail); //print("pat man drawer: " + endpointUserData + widget.userEmail);
var response = var response =
await http.get(Uri.parse(endpointUserData + widget.userEmail)); await http.get(Uri.parse(endpointUserData + widget.userEmail));
print(response.statusCode); // print(response.statusCode);
print(response.body); // print(response.body);
if (response.statusCode == 200) { if (response.statusCode == 200) {
return AppUser.fromJson( return AppUser.fromJson(
jsonDecode(response.body) as Map<String, dynamic>); jsonDecode(response.body) as Map<String, dynamic>);
@@ -44,87 +45,113 @@ class _PatManAppDrawerState extends State<PatManAppDrawer> {
future: signedInUser, future: signedInUser,
builder: (BuildContext context, AsyncSnapshot<AppUser> snapshot) { builder: (BuildContext context, AsyncSnapshot<AppUser> snapshot) {
return Drawer( return Drawer(
backgroundColor: MyTheme().primaryColor(),
child: ListView( child: ListView(
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
children: [ children: [
DrawerHeader( DrawerHeader(
decoration: const BoxDecoration( decoration: BoxDecoration(
color: Colors.blueAccent, color: MyTheme().secondaryColor(),
), ),
child: SizedBox( child: SizedBox(
height: 400, height: 400,
child: Expanded( child: Column(
child: Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min,
mainAxisSize: MainAxisSize.min, children: [
children: [ Text(
const Text( "Signed Is As:",
"Signed Is As:", style: TextStyle(
style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 20.0, fontSize: 20.0,
color: MyTheme().primaryColor()),
),
const SizedBox(
height: 50.0,
),
Row(
mainAxisSize: MainAxisSize.max,
children: [
Text(
"Name: ",
style: TextStyle(
fontWeight: FontWeight.bold,
color: MyTheme().primaryColor(),
),
), ),
), const SizedBox(width: 15),
const SizedBox( Text(
height: 50.0, "${snapshot.data?.fname} ${snapshot.data?.lname}",
), style: TextStyle(
Expanded( fontWeight: FontWeight.bold,
child: Row( color: MyTheme().primaryColor(),
mainAxisSize: MainAxisSize.max, ),
children: [
const Text(
"Name: ",
style: TextStyle(fontWeight: FontWeight.bold),
),
const SizedBox(width: 15),
Text(
"${snapshot.data?.fname} ${snapshot.data?.lname}"),
],
), ),
), ],
Expanded( ),
child: Row( Row(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: [ children: [
const Text( Text(
"Email: ", "Email: ",
style: TextStyle(fontWeight: FontWeight.bold), style: TextStyle(
), fontWeight: FontWeight.bold,
const SizedBox(width: 16), color: MyTheme().primaryColor(),
Text("${snapshot.data?.email}"), ),
],
), ),
), const SizedBox(width: 16),
], Text(
), "${snapshot.data?.email}",
style: TextStyle(
fontWeight: FontWeight.bold,
color: MyTheme().primaryColor(),
),
),
],
),
],
), ),
), ),
), ),
ListTile( ListTile(
title: const Expanded( title: Row(
child: Row( mainAxisSize: MainAxisSize.max,
mainAxisSize: MainAxisSize.max, children: [
children: [ Icon(
Icon(Icons.home_outlined), Icons.home_outlined,
SizedBox(width: 25.0), color: MyTheme().secondaryColor(),
Text("Home"), ),
], const SizedBox(width: 25.0),
), Text(
"Home",
style: TextStyle(
//fontWeight: FontWeight.bold,
color: MyTheme().secondaryColor(),
),
),
],
), ),
onTap: () { onTap: () {
Navigator.of(context).pushNamed('/home'); Navigator.of(context).pushNamed('/home');
}, },
), ),
ListTile( ListTile(
title: const Expanded( title: Row(
child: Row( mainAxisSize: MainAxisSize.max,
mainAxisSize: MainAxisSize.max, children: [
children: [ Icon(
Icon(Icons.perm_identity), Icons.perm_identity,
SizedBox(width: 25.0), color: MyTheme().secondaryColor(),
Text("Profile"), ),
], const SizedBox(width: 25.0),
), Text(
"Profile",
style: TextStyle(
//fontWeight: FontWeight.bold,
color: MyTheme().secondaryColor(),
),
),
],
), ),
onTap: () { onTap: () {
//signedInUser = snapshot.data!; //signedInUser = snapshot.data!;
@@ -134,15 +161,22 @@ class _PatManAppDrawerState extends State<PatManAppDrawer> {
}, },
), ),
ListTile( ListTile(
title: const Expanded( title: Row(
child: Row( mainAxisSize: MainAxisSize.max,
mainAxisSize: MainAxisSize.max, children: [
children: [ Icon(
Icon(Icons.logout), Icons.logout,
SizedBox(width: 25.0), color: MyTheme().secondaryColor(),
Text("Sign Out"), ),
], const SizedBox(width: 25.0),
), Text(
"Sign Out",
style: TextStyle(
//fontWeight: FontWeight.bold,
color: MyTheme().secondaryColor(),
),
),
],
), ),
onTap: () { onTap: () {
client.auth.signOut(); client.auth.signOut();
@@ -155,61 +189,4 @@ class _PatManAppDrawerState extends State<PatManAppDrawer> {
}, },
); );
} }
// Drawer(
// child: ListView(
// padding: EdgeInsets.zero,
// children: [
// DrawerHeader(
// decoration: const BoxDecoration(
// color: Colors.blueAccent,
// ),
// child: Column(
// children: [
// const Text("Signed Is As:"),
// Text("Name: ${signedInUser.fname} ${signedInUser.lname}"),
// Text("Email: ${signedInUser.email}"),
// ],
// ),
// ),
// ListTile(
// title: const Row(
// children: [
// Icon(Icons.home_outlined),
// SizedBox(width: 25.0),
// Text("Home"),
// ],
// ),
// onTap: () {
// Navigator.of(context).pushNamed('/home');
// },
// ),
// ListTile(
// title: const Row(
// children: [
// Icon(Icons.perm_identity),
// SizedBox(width: 25.0),
// Text("Profile"),
// ],
// ),
// onTap: () {
// //Navigator.of(context).pushNamed('/home');
// },
// ),
// ListTile(
// title: const Row(
// children: [
// Icon(Icons.logout),
// SizedBox(width: 25.0),
// Text("Sign Out"),
// ],
// ),
// onTap: () {
// client.auth.signOut();
// Navigator.of(context).pushNamed('/');
// },
// )
// ],
// ),
// );
} }

View File

@@ -1,6 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:patient_manager/components/myTextInput.dart'; import 'package:patient_manager/components/myTextInput.dart';
import 'package:patient_manager/objects/patients.dart'; import 'package:patient_manager/objects/patients.dart';
import 'package:patient_manager/theme/mihTheme.dart';
class PatientDetails extends StatefulWidget { class PatientDetails extends StatefulWidget {
final Patient selectedPatient; final Patient selectedPatient;
@@ -61,9 +62,9 @@ class _PatientDetailsState extends State<PatientDetails> {
return Container( return Container(
padding: const EdgeInsets.only(left: 20, right: 20, bottom: 10), padding: const EdgeInsets.only(left: 20, right: 20, bottom: 10),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: MyTheme().primaryColor(),
borderRadius: BorderRadius.circular(25.0), borderRadius: BorderRadius.circular(25.0),
border: Border.all(color: Colors.blueAccent, width: 3.0), border: Border.all(color: MyTheme().secondaryColor(), width: 3.0),
), ),
//constraints: const BoxConstraints.expand(height: 250.0), //constraints: const BoxConstraints.expand(height: 250.0),
child: Column( child: Column(
@@ -72,19 +73,19 @@ class _PatientDetailsState extends State<PatientDetails> {
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
//crossAxisAlignment: , //crossAxisAlignment: ,
children: [ children: [
const Text( Text(
"Patient Details", "Patient Details",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontSize: 25, fontSize: 25,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.blueAccent, color: MyTheme().secondaryColor(),
), ),
), ),
IconButton( IconButton(
icon: const Icon(Icons.edit), icon: const Icon(Icons.edit),
alignment: Alignment.topRight, alignment: Alignment.topRight,
color: Colors.blueAccent, color: MyTheme().secondaryColor(),
onPressed: () { onPressed: () {
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
'/patient-manager/patient/edit', '/patient-manager/patient/edit',
@@ -93,7 +94,7 @@ class _PatientDetailsState extends State<PatientDetails> {
) )
], ],
), ),
const Divider(color: Colors.blueAccent), Divider(color: MyTheme().secondaryColor()),
const SizedBox(height: 10), const SizedBox(height: 10),
Column( Column(
children: [ children: [
@@ -151,16 +152,16 @@ class _PatientDetailsState extends State<PatientDetails> {
], ],
), ),
const SizedBox(height: 10), const SizedBox(height: 10),
const Text( Text(
"Medical Aid Details", "Medical Aid Details",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontSize: 25, fontSize: 25,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.blueAccent, color: MyTheme().secondaryColor(),
), ),
), ),
const Divider(color: Colors.blueAccent), Divider(color: MyTheme().secondaryColor()),
const SizedBox(height: 10), const SizedBox(height: 10),
Column( Column(
children: [ children: [

View File

@@ -15,6 +15,7 @@ import 'package:patient_manager/objects/appUser.dart';
import 'package:patient_manager/objects/files.dart'; import 'package:patient_manager/objects/files.dart';
import 'package:http/http.dart' as http; import 'package:http/http.dart' as http;
import 'package:patient_manager/theme/mihTheme.dart';
import '../objects/patients.dart'; import '../objects/patients.dart';
@@ -240,18 +241,19 @@ class _PatientFilesState extends State<PatientFiles> {
width: 700.0, width: 700.0,
//height: 475.0, //height: 475.0,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: MyTheme().primaryColor(),
borderRadius: BorderRadius.circular(25.0), 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( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
const Text( Text(
"Create Medical Certificate", "Create Medical Certificate",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
color: Colors.blueAccent, color: MyTheme().secondaryColor(),
fontSize: 35.0, fontSize: 35.0,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
@@ -266,6 +268,9 @@ class _PatientFilesState extends State<PatientFiles> {
width: 300, width: 300,
height: 100, height: 100,
child: MyButton( child: MyButton(
buttonText: "Generate",
buttonColor: MyTheme().secondaryColor(),
textColor: MyTheme().primaryColor(),
onTap: () { onTap: () {
if (isMedCertFieldsFilled()) { if (isMedCertFieldsFilled()) {
generateMedCert(); generateMedCert();
@@ -280,9 +285,6 @@ class _PatientFilesState extends State<PatientFiles> {
); );
} }
}, },
buttonText: "Generate",
buttonColor: Colors.blueAccent,
textColor: Colors.white,
), ),
) )
], ],
@@ -297,9 +299,9 @@ class _PatientFilesState extends State<PatientFiles> {
onPressed: () { onPressed: () {
Navigator.pop(context); Navigator.pop(context);
}, },
icon: const Icon( icon: Icon(
Icons.close, Icons.close,
color: Colors.red, color: MyTheme().errorColor(),
size: 35, size: 35,
), ),
), ),
@@ -322,20 +324,21 @@ class _PatientFilesState extends State<PatientFiles> {
width: 900.0, width: 900.0,
//height: 475.0, //height: 475.0,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: MyTheme().primaryColor(),
borderRadius: BorderRadius.circular(25.0), 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( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
const Text( Text(
"Create Precrition", "Create Precrition",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
color: Colors.blueAccent, color: MyTheme().secondaryColor(),
fontSize: 35.0, fontSize: 35.0,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
@@ -368,9 +371,9 @@ class _PatientFilesState extends State<PatientFiles> {
noRepeatsController.clear(); noRepeatsController.clear();
Navigator.pop(context); Navigator.pop(context);
}, },
icon: const Icon( icon: Icon(
Icons.close, Icons.close,
color: Colors.red, color: MyTheme().errorColor(),
size: 35, size: 35,
), ),
), ),
@@ -393,18 +396,19 @@ class _PatientFilesState extends State<PatientFiles> {
width: 700.0, width: 700.0,
//height: 475.0, //height: 475.0,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: MyTheme().primaryColor(),
borderRadius: BorderRadius.circular(25.0), 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( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
const Text( Text(
"Upload File", "Upload File",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
color: Colors.blueAccent, color: MyTheme().secondaryColor(),
fontSize: 35.0, fontSize: 35.0,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
@@ -413,11 +417,14 @@ class _PatientFilesState extends State<PatientFiles> {
SizedBox( SizedBox(
width: 700, width: 700,
child: MyButton( child: MyButton(
buttonText: "Select File",
buttonColor: MyTheme().secondaryColor(),
textColor: MyTheme().primaryColor(),
onTap: () async { onTap: () async {
FilePickerResult? result = FilePickerResult? result =
await FilePicker.platform.pickFiles( await FilePicker.platform.pickFiles(
type: FileType.custom, type: FileType.custom,
allowedExtensions: ['jpg', 'pdf'], allowedExtensions: ['jpg', 'png', 'pdf'],
); );
if (result == null) return; if (result == null) return;
final selectedFile = result.files.first; final selectedFile = result.files.first;
@@ -429,9 +436,6 @@ class _PatientFilesState extends State<PatientFiles> {
selectedFileController.text = selectedFile.name; selectedFileController.text = selectedFile.name;
}); });
}, },
buttonText: "Select File",
buttonColor: Colors.blueAccent,
textColor: Colors.white,
), ),
), ),
MyTextField( MyTextField(
@@ -444,6 +448,9 @@ class _PatientFilesState extends State<PatientFiles> {
width: 300, width: 300,
height: 100, height: 100,
child: MyButton( child: MyButton(
buttonText: "Add File",
buttonColor: MyTheme().secondaryColor(),
textColor: MyTheme().primaryColor(),
onTap: () { onTap: () {
if (isFileFieldsFilled()) { if (isFileFieldsFilled()) {
uploadSelectedFile(selected); uploadSelectedFile(selected);
@@ -458,9 +465,6 @@ class _PatientFilesState extends State<PatientFiles> {
); );
} }
}, },
buttonText: "Add File",
buttonColor: Colors.blueAccent,
textColor: Colors.white,
), ),
) )
], ],
@@ -475,9 +479,9 @@ class _PatientFilesState extends State<PatientFiles> {
onPressed: () { onPressed: () {
Navigator.pop(context); Navigator.pop(context);
}, },
icon: const Icon( icon: Icon(
Icons.close, Icons.close,
color: Colors.red, color: MyTheme().errorColor(),
size: 35, size: 35,
), ),
), ),
@@ -537,9 +541,10 @@ class _PatientFilesState extends State<PatientFiles> {
child: Container( child: Container(
//height: 300.0, //height: 300.0,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: MyTheme().primaryColor(),
borderRadius: BorderRadius.circular(25.0), borderRadius: BorderRadius.circular(25.0),
border: Border.all(color: Colors.blueAccent, width: 3.0), border:
Border.all(color: MyTheme().secondaryColor(), width: 3.0),
), ),
child: Padding( child: Padding(
padding: const EdgeInsets.only(top: 5.0), padding: const EdgeInsets.only(top: 5.0),
@@ -547,47 +552,47 @@ class _PatientFilesState extends State<PatientFiles> {
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
const Text( Text(
"Files", "Files",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontSize: 25, fontSize: 25,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.blueAccent, color: MyTheme().secondaryColor(),
), ),
), ),
IconButton( IconButton(
onPressed: () { onPressed: () {
medCertPopUp(); medCertPopUp();
}, },
icon: const Icon( icon: Icon(
Icons.sick_outlined, Icons.sick_outlined,
color: Colors.blueAccent, color: MyTheme().secondaryColor(),
), ),
), ),
IconButton( IconButton(
onPressed: () { onPressed: () {
prescritionPopUp(); prescritionPopUp();
}, },
icon: const Icon( icon: Icon(
Icons.medication_outlined, Icons.medication_outlined,
color: Colors.blueAccent, color: MyTheme().secondaryColor(),
), ),
), ),
IconButton( IconButton(
onPressed: () { onPressed: () {
uploudFilePopUp(); uploudFilePopUp();
}, },
icon: const Icon( icon: Icon(
Icons.add, Icons.add,
color: Colors.blueAccent, color: MyTheme().secondaryColor(),
), ),
) )
], ],
), ),
const Padding( Padding(
padding: EdgeInsets.symmetric(horizontal: 20.0), padding: const EdgeInsets.symmetric(horizontal: 20.0),
child: Divider(color: Colors.blueAccent), child: Divider(color: MyTheme().secondaryColor()),
), ),
const SizedBox(height: 10), const SizedBox(height: 10),
BuildFilesList(files: filesList), BuildFilesList(files: filesList),

View File

@@ -9,6 +9,7 @@ import 'package:patient_manager/components/myTextInput.dart';
import 'package:patient_manager/components/mybutton.dart'; import 'package:patient_manager/components/mybutton.dart';
import 'package:patient_manager/objects/notes.dart'; import 'package:patient_manager/objects/notes.dart';
import 'package:http/http.dart' as http; import 'package:http/http.dart' as http;
import 'package:patient_manager/theme/mihTheme.dart';
class PatientNotes extends StatefulWidget { class PatientNotes extends StatefulWidget {
final int patientIndex; final int patientIndex;
@@ -109,18 +110,19 @@ class _PatientNotesState extends State<PatientNotes> {
width: 700.0, width: 700.0,
//height: 500.0, //height: 500.0,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: MyTheme().primaryColor(),
borderRadius: BorderRadius.circular(25.0), 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( child: Column(
//mainAxisSize: MainAxisSize.max, //mainAxisSize: MainAxisSize.max,
children: [ children: [
const Text( Text(
"Add Note", "Add Note",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
color: Colors.blueAccent, color: MyTheme().secondaryColor(),
fontSize: 35.0, fontSize: 35.0,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
@@ -163,8 +165,8 @@ class _PatientNotesState extends State<PatientNotes> {
} }
}, },
buttonText: "Add Note", buttonText: "Add Note",
buttonColor: Colors.blueAccent, buttonColor: MyTheme().secondaryColor(),
textColor: Colors.white, textColor: MyTheme().primaryColor(),
), ),
) )
], ],
@@ -181,9 +183,9 @@ class _PatientNotesState extends State<PatientNotes> {
titleController.clear(); titleController.clear();
noteTextController.clear(); noteTextController.clear();
}, },
icon: const Icon( icon: Icon(
Icons.close, Icons.close,
color: Colors.red, color: MyTheme().errorColor(),
size: 35, size: 35,
), ),
), ),
@@ -222,9 +224,10 @@ class _PatientNotesState extends State<PatientNotes> {
child: Container( child: Container(
//height: 300.0, //height: 300.0,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: MyTheme().primaryColor(),
borderRadius: BorderRadius.circular(25.0), borderRadius: BorderRadius.circular(25.0),
border: Border.all(color: Colors.blueAccent, width: 3.0), border:
Border.all(color: MyTheme().secondaryColor(), width: 3.0),
), ),
child: Padding( child: Padding(
padding: const EdgeInsets.only(top: 5.0), padding: const EdgeInsets.only(top: 5.0),
@@ -232,25 +235,26 @@ class _PatientNotesState extends State<PatientNotes> {
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
const Text( Text(
"Notes", "Notes",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontSize: 25, fontSize: 25,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.blueAccent), color: MyTheme().secondaryColor()),
), ),
IconButton( IconButton(
onPressed: () { onPressed: () {
addNotePopUp(); addNotePopUp();
}, },
icon: const Icon(Icons.add, color: Colors.blueAccent), icon:
Icon(Icons.add, color: MyTheme().secondaryColor()),
) )
], ],
), ),
const Padding( Padding(
padding: EdgeInsets.symmetric(horizontal: 20.0), padding: const EdgeInsets.symmetric(horizontal: 20.0),
child: Divider(color: Colors.blueAccent), child: Divider(color: MyTheme().secondaryColor()),
), ),
const SizedBox(height: 10), const SizedBox(height: 10),
BuildNotesList(notes: notesList), BuildNotesList(notes: notesList),

View File

@@ -4,6 +4,7 @@ import 'package:patient_manager/components/myDropdownInput.dart';
import 'package:patient_manager/components/myErrorMessage.dart'; import 'package:patient_manager/components/myErrorMessage.dart';
import 'package:patient_manager/components/mySearchInput.dart'; import 'package:patient_manager/components/mySearchInput.dart';
import 'package:patient_manager/components/mybutton.dart'; import 'package:patient_manager/components/mybutton.dart';
import 'package:patient_manager/theme/mihTheme.dart';
class PrescripInput extends StatefulWidget { class PrescripInput extends StatefulWidget {
final TextEditingController medicineController; final TextEditingController medicineController;
@@ -187,6 +188,9 @@ class _PrescripInputState extends State<PrescripInput> {
SizedBox( SizedBox(
width: 300, width: 300,
child: MyButton( child: MyButton(
buttonText: "Add",
buttonColor: MyTheme().secondaryColor(),
textColor: MyTheme().primaryColor(),
onTap: () { onTap: () {
if (isFieldsFilled()) { if (isFieldsFilled()) {
setState(() { setState(() {
@@ -209,9 +213,6 @@ class _PrescripInputState extends State<PrescripInput> {
); );
} }
}, },
buttonText: "Add",
buttonColor: Colors.blueAccent,
textColor: Colors.white,
), ),
) )
], ],
@@ -225,9 +226,9 @@ class _PrescripInputState extends State<PrescripInput> {
width: 550, width: 550,
height: 400, height: 400,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: MyTheme().primaryColor(),
borderRadius: BorderRadius.circular(25.0), borderRadius: BorderRadius.circular(25.0),
border: Border.all(color: Colors.blueAccent, width: 3.0), border: Border.all(color: MyTheme().secondaryColor(), width: 3.0),
), ),
child: ListView.separated( child: ListView.separated(
separatorBuilder: (BuildContext context, int index) { separatorBuilder: (BuildContext context, int index) {
@@ -239,14 +240,21 @@ class _PrescripInputState extends State<PrescripInput> {
return ListTile( return ListTile(
title: Text( title: Text(
getPerscTitle(index), getPerscTitle(index),
style: TextStyle(
color: MyTheme().secondaryColor(),
),
), ),
subtitle: Text( subtitle: Text(
getPerscSubtitle(index), getPerscSubtitle(index),
style: TextStyle(
color: MyTheme().secondaryColor(),
),
), ),
//onTap: () {}, //onTap: () {},
trailing: IconButton( trailing: IconButton(
icon: const Icon( icon: Icon(
Icons.delete_forever_outlined, Icons.delete_forever_outlined,
color: MyTheme().primaryColor(),
), ),
onPressed: () { onPressed: () {
setState(() { setState(() {
@@ -277,8 +285,8 @@ class _PrescripInputState extends State<PrescripInput> {
// } // }
}, },
buttonText: "Generate", buttonText: "Generate",
buttonColor: Colors.green, buttonColor: MyTheme().successColor(),
textColor: Colors.white, textColor: MyTheme().primaryColor(),
), ),
) )
], ],

View File

@@ -1,5 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:patient_manager/router/routeGenerator.dart'; import 'package:patient_manager/router/routeGenerator.dart';
import 'package:patient_manager/theme/mihTheme.dart';
import 'package:supabase_flutter/supabase_flutter.dart'; import 'package:supabase_flutter/supabase_flutter.dart';
void main() async { void main() async {
@@ -19,9 +20,9 @@ class MzanziInnovationHub extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return const MaterialApp( return MaterialApp(
title: 'Mzansi Innovation Hub', title: 'Mzansi Innovation Hub',
themeMode: ThemeMode.system, theme: MyTheme().data,
debugShowCheckedModeBanner: false, debugShowCheckedModeBanner: false,
initialRoute: '/', initialRoute: '/',
onGenerateRoute: RouteGenerator.generateRoute, onGenerateRoute: RouteGenerator.generateRoute,

View File

@@ -2,7 +2,10 @@ import 'package:flutter/material.dart';
import 'package:patient_manager/components/homeTileGrid.dart'; import 'package:patient_manager/components/homeTileGrid.dart';
import 'package:patient_manager/components/myAppBar.dart'; import 'package:patient_manager/components/myAppBar.dart';
import 'package:patient_manager/components/homeAppDrawer.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/main.dart';
//import 'package:patient_manager/theme/mihTheme.dart';
class Home extends StatefulWidget { class Home extends StatefulWidget {
//final String userEmail; //final String userEmail;
@@ -42,6 +45,32 @@ class _HomeState extends State<Home> {
body: HomeTileGrid( body: HomeTileGrid(
userEmail: useremail, 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 { } else {
return const Center(child: CircularProgressIndicator()); return const Center(child: CircularProgressIndicator());

View File

@@ -7,6 +7,7 @@ import 'package:patient_manager/components/mySuccessMessage.dart';
import 'package:patient_manager/components/myTextInput.dart'; import 'package:patient_manager/components/myTextInput.dart';
import 'package:patient_manager/components/mybutton.dart'; import 'package:patient_manager/components/mybutton.dart';
import 'package:patient_manager/objects/appUser.dart'; import 'package:patient_manager/objects/appUser.dart';
import 'package:patient_manager/theme/mihTheme.dart';
import '../components/myAppBar.dart'; import '../components/myAppBar.dart';
import 'package:http/http.dart' as http; import 'package:http/http.dart' as http;
@@ -176,13 +177,13 @@ class _AddPatientState extends State<AddPatient> {
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
children: [ children: [
const Text( Text(
"Personal Details", "Personal Details",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 25.0, fontSize: 25.0,
//color: Colors.blueAccent, color: MyTheme().secondaryColor(),
), ),
), ),
Row( Row(
@@ -263,13 +264,13 @@ class _AddPatientState extends State<AddPatient> {
], ],
), ),
const SizedBox(height: 15.0), const SizedBox(height: 15.0),
const Text( Text(
"Medical Aid Details", "Medical Aid Details",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 25.0, fontSize: 25.0,
//color: Colors.blueAccent, color: MyTheme().secondaryColor(),
), ),
), ),
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
@@ -377,8 +378,8 @@ class _AddPatientState extends State<AddPatient> {
} }
}, },
buttonText: "Add", buttonText: "Add",
buttonColor: Colors.blueAccent, buttonColor: MyTheme().secondaryColor(),
textColor: Colors.white, textColor: MyTheme().primaryColor(),
), ),
), ),
], ],

View File

@@ -7,6 +7,7 @@ import 'package:patient_manager/components/mySuccessMessage.dart';
import 'package:patient_manager/components/myTextInput.dart'; import 'package:patient_manager/components/myTextInput.dart';
import 'package:patient_manager/components/mybutton.dart'; import 'package:patient_manager/components/mybutton.dart';
import 'package:patient_manager/objects/appUser.dart'; import 'package:patient_manager/objects/appUser.dart';
import 'package:patient_manager/theme/mihTheme.dart';
import 'package:supabase_flutter/supabase_flutter.dart'; import 'package:supabase_flutter/supabase_flutter.dart';
import '../components/myAppBar.dart'; import '../components/myAppBar.dart';
import 'package:http/http.dart' as http; import 'package:http/http.dart' as http;
@@ -171,24 +172,25 @@ class _EditPatientState extends State<EditPatient> {
width: 500.0, width: 500.0,
height: 475.0, height: 475.0,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: MyTheme().primaryColor(),
borderRadius: BorderRadius.circular(25.0), 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( child: Column(
//mainAxisSize: MainAxisSize.max, //mainAxisSize: MainAxisSize.max,
children: [ children: [
const Icon( Icon(
Icons.warning_amber_rounded, Icons.warning_amber_rounded,
size: 100, size: 100,
color: Colors.blueAccent, color: MyTheme().secondaryColor(),
), ),
const SizedBox(height: 15), const SizedBox(height: 15),
const Text( Text(
"Are you sure you want to delete this?", "Are you sure you want to delete this?",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
color: Colors.blueAccent, color: MyTheme().secondaryColor(),
fontSize: 25.0, fontSize: 25.0,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
@@ -198,35 +200,35 @@ class _EditPatientState extends State<EditPatient> {
padding: const EdgeInsets.symmetric(horizontal: 25.0), padding: const EdgeInsets.symmetric(horizontal: 25.0),
child: Text( 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.", "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( style: TextStyle(
color: Colors.black, color: MyTheme().secondaryColor(),
fontSize: 15.0, fontSize: 15.0,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
), ),
), ),
const SizedBox(height: 15), const SizedBox(height: 15),
const Padding( Padding(
padding: EdgeInsets.symmetric(horizontal: 25.0), padding: const EdgeInsets.symmetric(horizontal: 25.0),
child: Text( child: Text(
"Here's what you'll be deleting:", "Here's what you'll be deleting:",
style: TextStyle( style: TextStyle(
color: Colors.black, color: MyTheme().secondaryColor(),
fontSize: 20.0, fontSize: 20.0,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
), ),
), ),
const SizedBox(height: 10), const SizedBox(height: 10),
const Padding( Padding(
padding: EdgeInsets.symmetric(horizontal: 25.0), padding: const EdgeInsets.symmetric(horizontal: 25.0),
child: SizedBox( child: SizedBox(
width: 450, width: 450,
child: Text( child: Text(
"1) Patient Profile Information.\n2) Patient Notes\n3) Patient Files.", "1) Patient Profile Information.\n2) Patient Notes\n3) Patient Files.",
textAlign: TextAlign.left, textAlign: TextAlign.left,
style: TextStyle( style: TextStyle(
color: Colors.black, color: MyTheme().secondaryColor(),
fontSize: 15.0, fontSize: 15.0,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
@@ -239,8 +241,8 @@ class _EditPatientState extends State<EditPatient> {
child: MyButton( child: MyButton(
onTap: deletePatientApiCall, onTap: deletePatientApiCall,
buttonText: "Delete", buttonText: "Delete",
buttonColor: Colors.blueAccent, buttonColor: MyTheme().secondaryColor(),
textColor: Colors.white, textColor: MyTheme().primaryColor(),
)) ))
], ],
), ),
@@ -254,9 +256,9 @@ class _EditPatientState extends State<EditPatient> {
onPressed: () { onPressed: () {
Navigator.pop(context); Navigator.pop(context);
}, },
icon: const Icon( icon: Icon(
Icons.close, Icons.close,
color: Colors.red, color: MyTheme().errorColor(),
size: 35, size: 35,
), ),
), ),
@@ -334,17 +336,18 @@ class _EditPatientState extends State<EditPatient> {
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
const Text( Text(
"Personal Details", "Personal Details",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 25.0, fontSize: 25.0,
//color: Colors.blueAccent, color: MyTheme().secondaryColor(),
), ),
), ),
IconButton( IconButton(
icon: const Icon(Icons.delete), icon: const Icon(Icons.delete),
color: MyTheme().secondaryColor(),
alignment: Alignment.topRight, alignment: Alignment.topRight,
onPressed: () { onPressed: () {
deletePatientPopUp(); deletePatientPopUp();
@@ -430,13 +433,13 @@ class _EditPatientState extends State<EditPatient> {
], ],
), ),
const SizedBox(height: 15.0), const SizedBox(height: 15.0),
const Text( Text(
"Medical Aid Details", "Medical Aid Details",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 25.0, fontSize: 25.0,
//color: Colors.blueAccent, color: MyTheme().secondaryColor(),
), ),
), ),
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
@@ -544,8 +547,8 @@ class _EditPatientState extends State<EditPatient> {
} }
}, },
buttonText: "Update", buttonText: "Update",
buttonColor: Colors.blueAccent, buttonColor: MyTheme().secondaryColor(),
textColor: Colors.white, textColor: MyTheme().primaryColor(),
), ),
), ),
], ],

View File

@@ -8,6 +8,7 @@ import 'package:http/http.dart' as http;
import 'package:patient_manager/components/mySearchInput.dart'; import 'package:patient_manager/components/mySearchInput.dart';
import 'package:patient_manager/components/patManAppDrawer.dart'; import 'package:patient_manager/components/patManAppDrawer.dart';
import 'package:patient_manager/objects/patients.dart'; import 'package:patient_manager/objects/patients.dart';
import 'package:patient_manager/theme/mihTheme.dart';
class PatientManager extends StatefulWidget { class PatientManager extends StatefulWidget {
final String userEmail; final String userEmail;
@@ -72,9 +73,12 @@ class _PatientManagerState extends State<PatientManager> {
child: Container( child: Container(
height: 500, height: 500,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: MyTheme().primaryColor(),
borderRadius: BorderRadius.circular(25.0), 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( child: BuildPatientsList(
patients: patientsList, patients: patientsList,
@@ -92,14 +96,14 @@ class _PatientManagerState extends State<PatientManager> {
child: Container( child: Container(
height: 500, height: 500,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: MyTheme().primaryColor(),
borderRadius: BorderRadius.circular(25.0), 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( child: Text(
"Enter ID or Medical Aid No. of Patient", "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, textAlign: TextAlign.center,
), ),
), ),
@@ -173,21 +177,21 @@ class _PatientManagerState extends State<PatientManager> {
floatingActionButton: Padding( floatingActionButton: Padding(
padding: const EdgeInsets.only(top: 65, right: 5), padding: const EdgeInsets.only(top: 65, right: 5),
child: FloatingActionButton.extended( child: FloatingActionButton.extended(
label: const Text( label: Text(
"Add Patient", "Add Patient",
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.white, color: MyTheme().primaryColor(),
), ),
), ),
backgroundColor: Colors.blueAccent, //backgroundColor: Colors.blueAccent,
onPressed: () { onPressed: () {
Navigator.of(context) Navigator.of(context)
.pushNamed('/patient-manager/add', arguments: widget.userEmail); .pushNamed('/patient-manager/add', arguments: widget.userEmail);
}, },
icon: const Icon( icon: Icon(
Icons.add, Icons.add,
color: Colors.white, color: MyTheme().primaryColor(),
), ),
), ),
), ),

View File

@@ -32,7 +32,7 @@ class _PatientViewState extends State<PatientView> {
PatientNotes( PatientNotes(
patientIndex: widget.selectedPatient.idpatients, patientIndex: widget.selectedPatient.idpatients,
), ),
SizedBox( const SizedBox(
width: 10, width: 10,
), ),
PatientFiles( PatientFiles(

View File

@@ -3,6 +3,7 @@ import 'package:patient_manager/components/myPassInput.dart';
import 'package:patient_manager/components/myTextInput.dart'; import 'package:patient_manager/components/myTextInput.dart';
import 'package:patient_manager/components/mybutton.dart'; import 'package:patient_manager/components/mybutton.dart';
import 'package:patient_manager/main.dart'; import 'package:patient_manager/main.dart';
import 'package:patient_manager/theme/mihTheme.dart';
import 'package:supabase_auth_ui/supabase_auth_ui.dart'; import 'package:supabase_auth_ui/supabase_auth_ui.dart';
class Register extends StatefulWidget { class Register extends StatefulWidget {
@@ -62,7 +63,7 @@ class _RegisterState extends State<Register> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
backgroundColor: Colors.white, //backgroundColor: Colors.white,
body: SafeArea( body: SafeArea(
child: Center( child: Center(
child: SingleChildScrollView( child: SingleChildScrollView(
@@ -71,20 +72,20 @@ class _RegisterState extends State<Register> {
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
//logo //logo
const Icon( Icon(
Icons.lock, Icons.lock,
size: 100, size: 100,
color: Colors.blueAccent, color: MyTheme().secondaryColor(),
), ),
//spacer //spacer
const SizedBox(height: 10), const SizedBox(height: 10),
//Heading //Heading
const Text( Text(
'Register', 'Register',
style: TextStyle( style: TextStyle(
fontSize: 25, fontSize: 25,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.blueAccent, color: MyTheme().secondaryColor(),
), ),
), ),
//spacer //spacer
@@ -135,58 +136,44 @@ class _RegisterState extends State<Register> {
), ),
//spacer //spacer
const SizedBox(height: 10), 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 // sign up button
SizedBox( SizedBox(
width: 500.0, width: 500.0,
height: 100.0,
child: MyButton( child: MyButton(
onTap: () {}, onTap: () {},
buttonText: "Sign Up", buttonText: "Sign Up",
buttonColor: Colors.blueAccent, buttonColor: MyTheme().secondaryColor(),
textColor: Colors.white, textColor: MyTheme().primaryColor(),
), ),
), ),
//spacer
const SizedBox(height: 30),
//register text //register text
Row( SizedBox(
mainAxisAlignment: MainAxisAlignment.center, width: 450.0,
children: [ height: 100.0,
const Text( child: Row(
'Already a User?', mainAxisAlignment: MainAxisAlignment.end,
style: TextStyle(fontSize: 18, color: Colors.grey), children: [
), const Text(
const SizedBox( 'Already a User?',
width: 6, style: TextStyle(fontSize: 18, color: Colors.grey),
),
GestureDetector(
onTap: widget.onTap,
child: const Text(
'Sign In',
style: TextStyle(
fontSize: 18,
color: Colors.blueAccent,
fontWeight: FontWeight.bold,
),
), ),
) const SizedBox(
], width: 6,
),
GestureDetector(
onTap: widget.onTap,
child: Text(
'Sign In',
style: TextStyle(
fontSize: 18,
color: MyTheme().secondaryColor(),
fontWeight: FontWeight.bold,
),
),
)
],
),
) )
], ],
), ),

View File

@@ -4,6 +4,7 @@ import 'package:patient_manager/components/myPassInput.dart';
import 'package:patient_manager/components/myTextInput.dart'; import 'package:patient_manager/components/myTextInput.dart';
import 'package:patient_manager/components/mybutton.dart'; import 'package:patient_manager/components/mybutton.dart';
import 'package:patient_manager/main.dart'; import 'package:patient_manager/main.dart';
import 'package:patient_manager/theme/mihTheme.dart';
import 'package:supabase_auth_ui/supabase_auth_ui.dart'; import 'package:supabase_auth_ui/supabase_auth_ui.dart';
class SignIn extends StatefulWidget { class SignIn extends StatefulWidget {
@@ -52,7 +53,7 @@ class _SignInState extends State<SignIn> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
backgroundColor: Colors.white, //backgroundColor: Colors.white,
body: SafeArea( body: SafeArea(
child: Center( child: Center(
child: SingleChildScrollView( child: SingleChildScrollView(
@@ -61,20 +62,20 @@ class _SignInState extends State<SignIn> {
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
//logo //logo
const Icon( Icon(
Icons.lock, Icons.lock,
size: 100, size: 100,
color: Colors.blueAccent, color: MyTheme().secondaryColor(),
), ),
//spacer //spacer
const SizedBox(height: 10), const SizedBox(height: 10),
//Heading //Heading
const Text( Text(
'Sign In', 'Sign In',
style: TextStyle( style: TextStyle(
fontSize: 25, fontSize: 25,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.blueAccent, color: MyTheme().secondaryColor(),
), ),
), ),
//spacer //spacer
@@ -107,6 +108,9 @@ class _SignInState extends State<SignIn> {
width: 500.0, width: 500.0,
height: 100.0, height: 100.0,
child: MyButton( child: MyButton(
buttonText: "Sign In",
buttonColor: MyTheme().secondaryColor(),
textColor: MyTheme().primaryColor(),
onTap: () { onTap: () {
if (emailController.text.isEmpty || if (emailController.text.isEmpty ||
passwordController.text.isEmpty) { passwordController.text.isEmpty) {
@@ -125,36 +129,39 @@ class _SignInState extends State<SignIn> {
Navigator.of(context).pushNamed('/homme'); Navigator.of(context).pushNamed('/homme');
} }
}, },
buttonText: "Sign In",
buttonColor: Colors.blueAccent,
textColor: Colors.white,
), ),
), ),
//spacer //spacer
const SizedBox(height: 30), //const SizedBox(height: 30),
//register text //register text
Row( SizedBox(
mainAxisAlignment: MainAxisAlignment.center, width: 450.0,
children: [ height: 100.0,
const Text( child: Row(
'New User?', mainAxisAlignment: MainAxisAlignment.end,
style: TextStyle(fontSize: 18, color: Colors.grey), children: [
), const Text(
const SizedBox( 'New User?',
width: 6,
),
GestureDetector(
onTap: widget.onTap,
child: const Text(
'Register Now',
style: TextStyle( style: TextStyle(
fontSize: 18, fontSize: 18,
color: Colors.blueAccent, color: Color.fromARGB(255, 201, 200, 200)),
fontWeight: FontWeight.bold,
),
), ),
) const SizedBox(
], width: 6,
),
GestureDetector(
onTap: widget.onTap,
child: Text(
'Register Now',
style: TextStyle(
fontSize: 18,
color: MyTheme().secondaryColor(),
fontWeight: FontWeight.bold,
),
),
)
],
),
) )
], ],
), ),

View File

@@ -0,0 +1,77 @@
import 'package:flutter/material.dart';
class MyTheme {
late int _mainColor;
late int _secondColor;
late int _errColor;
late int _succColor;
late int _mesColor;
late ThemeData data;
// Options:-
// f3f9d2 = Cream
// f0f0c9 = cream2
// caffd0 = light green
// B0F2B4 = light grean 2 *
// 85bda6 = light green 3
// 70f8ba = green
// F7F3EA = white
// a63446 = red
MyTheme() {
_mainColor = 0XFF3A4454;
_secondColor = 0XFFbedcfe;
_errColor = 0xffD87E8B;
_succColor = 0xffB0F2B4;
_mesColor = 0xffc8c8c8d9;
data = ThemeData(
scaffoldBackgroundColor: primaryColor(),
colorScheme: ColorScheme.dark(
primary: messageTextColor(),
onPrimary: primaryColor(),
onSurface: secondaryColor(),
),
datePickerTheme: DatePickerThemeData(
backgroundColor: primaryColor(),
//------------------------------
cancelButtonStyle: ButtonStyle(
foregroundColor: WidgetStatePropertyAll(secondaryColor()),
overlayColor: WidgetStatePropertyAll(messageTextColor()),
),
//------------------------------
confirmButtonStyle: ButtonStyle(
foregroundColor: WidgetStatePropertyAll(secondaryColor()),
overlayColor: WidgetStatePropertyAll(messageTextColor()),
),
headerBackgroundColor: secondaryColor(),
headerForegroundColor: primaryColor(),
),
appBarTheme: AppBarTheme(
color: secondaryColor(),
),
floatingActionButtonTheme:
FloatingActionButtonThemeData(backgroundColor: secondaryColor()),
);
}
Color messageTextColor() {
return Color(_mesColor);
}
Color errorColor() {
return Color(_errColor);
}
Color successColor() {
return Color(_succColor);
}
Color primaryColor() {
return Color(_mainColor);
}
Color secondaryColor() {
return Color(_secondColor);
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.