UX update to add thene class and apply the theme to entire app
This commit is contained in:
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:patient_manager/components/BuildFileView.dart';
|
||||
import 'package:patient_manager/components/mybutton.dart';
|
||||
import 'package:patient_manager/objects/files.dart';
|
||||
import 'package:patient_manager/theme/mihTheme.dart';
|
||||
//import 'dart:js' as js;
|
||||
import "package:universal_html/html.dart" as html;
|
||||
|
||||
@@ -22,6 +23,7 @@ class _BuildFilesListState extends State<BuildFilesList> {
|
||||
void viewFilePopUp(String filename) {
|
||||
showDialog(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (context) => Dialog(
|
||||
child: Stack(
|
||||
children: [
|
||||
@@ -30,9 +32,10 @@ class _BuildFilesListState extends State<BuildFilesList> {
|
||||
width: 800.0,
|
||||
//height: 475.0,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
color: MyTheme().primaryColor(),
|
||||
borderRadius: BorderRadius.circular(25.0),
|
||||
border: Border.all(color: Colors.blueAccent, width: 5.0),
|
||||
border:
|
||||
Border.all(color: MyTheme().secondaryColor(), width: 5.0),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
@@ -40,8 +43,8 @@ class _BuildFilesListState extends State<BuildFilesList> {
|
||||
Text(
|
||||
filename,
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(
|
||||
color: Colors.blueAccent,
|
||||
style: TextStyle(
|
||||
color: MyTheme().secondaryColor(),
|
||||
fontSize: 35.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -59,8 +62,8 @@ class _BuildFilesListState extends State<BuildFilesList> {
|
||||
'http://localhost:9000/mih/$filename', 'download');
|
||||
},
|
||||
buttonText: "Dowload",
|
||||
buttonColor: Colors.blueAccent,
|
||||
textColor: Colors.white,
|
||||
buttonColor: MyTheme().secondaryColor(),
|
||||
textColor: MyTheme().primaryColor(),
|
||||
),
|
||||
)
|
||||
],
|
||||
@@ -75,9 +78,9 @@ class _BuildFilesListState extends State<BuildFilesList> {
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
icon: const Icon(
|
||||
icon: Icon(
|
||||
Icons.close,
|
||||
color: Colors.red,
|
||||
color: MyTheme().errorColor(),
|
||||
size: 35,
|
||||
),
|
||||
),
|
||||
@@ -96,16 +99,29 @@ class _BuildFilesListState extends State<BuildFilesList> {
|
||||
child: ListView.separated(
|
||||
shrinkWrap: true,
|
||||
separatorBuilder: (BuildContext context, int index) {
|
||||
return const Divider();
|
||||
return Divider(
|
||||
color: MyTheme().secondaryColor(),
|
||||
);
|
||||
},
|
||||
itemCount: widget.files.length,
|
||||
itemBuilder: (context, index) {
|
||||
return ListTile(
|
||||
title: Text(
|
||||
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: () {
|
||||
viewFilePopUp(widget.files[index].file_name);
|
||||
},
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:patient_manager/objects/medicine.dart';
|
||||
import 'package:patient_manager/theme/mihTheme.dart';
|
||||
|
||||
class BuildMedicinesList extends StatefulWidget {
|
||||
final TextEditingController contoller;
|
||||
@@ -24,15 +25,26 @@ class _BuildMedicinesListState extends State<BuildMedicinesList> {
|
||||
Widget build(BuildContext context) {
|
||||
return ListView.separated(
|
||||
separatorBuilder: (BuildContext context, int index) {
|
||||
return const Divider();
|
||||
return Divider(
|
||||
color: MyTheme().secondaryColor(),
|
||||
);
|
||||
},
|
||||
itemCount: widget.medicines.length,
|
||||
itemBuilder: (context, index) {
|
||||
//final patient = widget.patients[index].id_no.contains(widget.searchString);
|
||||
return ListTile(
|
||||
title: Text(widget.medicines[index].name),
|
||||
title: Text(
|
||||
widget.medicines[index].name,
|
||||
style: TextStyle(
|
||||
color: MyTheme().secondaryColor(),
|
||||
),
|
||||
),
|
||||
subtitle: Text(
|
||||
"${widget.medicines[index].unit} - ${widget.medicines[index].form}"),
|
||||
"${widget.medicines[index].unit} - ${widget.medicines[index].form}",
|
||||
style: TextStyle(
|
||||
color: MyTheme().secondaryColor(),
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
setState(() {
|
||||
widget.contoller.text =
|
||||
@@ -40,7 +52,10 @@ class _BuildMedicinesListState extends State<BuildMedicinesList> {
|
||||
Navigator.of(context).pop();
|
||||
});
|
||||
},
|
||||
trailing: const Icon(Icons.arrow_forward),
|
||||
trailing: Icon(
|
||||
Icons.arrow_forward,
|
||||
color: MyTheme().secondaryColor(),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:patient_manager/components/myMLTextInput.dart';
|
||||
//import 'package:patient_manager/components/mybutton.dart';
|
||||
import 'package:patient_manager/objects/notes.dart';
|
||||
import 'package:patient_manager/theme/mihTheme.dart';
|
||||
|
||||
class BuildNotesList extends StatefulWidget {
|
||||
final List<Note> notes;
|
||||
@@ -24,6 +25,7 @@ class _BuildNotesListState extends State<BuildNotesList> {
|
||||
});
|
||||
showDialog(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (context) => Dialog(
|
||||
child: Stack(
|
||||
children: [
|
||||
@@ -32,9 +34,10 @@ class _BuildNotesListState extends State<BuildNotesList> {
|
||||
width: 700.0,
|
||||
//height: 475.0,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
color: MyTheme().primaryColor(),
|
||||
borderRadius: BorderRadius.circular(25.0),
|
||||
border: Border.all(color: Colors.blueAccent, width: 5.0),
|
||||
border:
|
||||
Border.all(color: MyTheme().secondaryColor(), width: 5.0),
|
||||
),
|
||||
child: Column(
|
||||
//mainAxisSize: MainAxisSize.max,
|
||||
@@ -42,8 +45,8 @@ class _BuildNotesListState extends State<BuildNotesList> {
|
||||
Text(
|
||||
title,
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(
|
||||
color: Colors.blueAccent,
|
||||
style: TextStyle(
|
||||
color: MyTheme().secondaryColor(),
|
||||
fontSize: 35.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -82,9 +85,9 @@ class _BuildNotesListState extends State<BuildNotesList> {
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
icon: const Icon(
|
||||
icon: Icon(
|
||||
Icons.close,
|
||||
color: Colors.red,
|
||||
color: MyTheme().errorColor(),
|
||||
size: 35,
|
||||
),
|
||||
),
|
||||
@@ -103,17 +106,29 @@ class _BuildNotesListState extends State<BuildNotesList> {
|
||||
child: ListView.separated(
|
||||
shrinkWrap: true,
|
||||
separatorBuilder: (BuildContext context, int index) {
|
||||
return const Divider();
|
||||
return Divider(
|
||||
color: MyTheme().secondaryColor(),
|
||||
);
|
||||
},
|
||||
itemCount: widget.notes.length,
|
||||
itemBuilder: (context, index) {
|
||||
return ListTile(
|
||||
title: Text(
|
||||
widget.notes[index].note_name,
|
||||
style: TextStyle(
|
||||
color: MyTheme().secondaryColor(),
|
||||
),
|
||||
),
|
||||
subtitle: Text(
|
||||
"${widget.notes[index].insert_date}:\n${widget.notes[index].note_text}"), //Text(widget.notes[index].note_text),
|
||||
trailing: const Icon(Icons.arrow_forward),
|
||||
"${widget.notes[index].insert_date}:\n${widget.notes[index].note_text}",
|
||||
style: TextStyle(
|
||||
color: MyTheme().secondaryColor(),
|
||||
),
|
||||
), //Text(widget.notes[index].note_text),
|
||||
trailing: Icon(
|
||||
Icons.arrow_forward,
|
||||
color: MyTheme().secondaryColor(),
|
||||
),
|
||||
onTap: () {
|
||||
viewNotePopUp(widget.notes[index].note_name,
|
||||
"${widget.notes[index].insert_date}:\n${widget.notes[index].note_text}");
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:patient_manager/objects/patients.dart';
|
||||
import 'package:patient_manager/theme/mihTheme.dart';
|
||||
|
||||
class BuildPatientsList extends StatefulWidget {
|
||||
final List<Patient> patients;
|
||||
@@ -21,14 +22,25 @@ class _BuildPatientsListState extends State<BuildPatientsList> {
|
||||
return Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
const Icon(Icons.star_border_rounded),
|
||||
Icon(
|
||||
Icons.star_border_rounded,
|
||||
color: MyTheme().secondaryColor(),
|
||||
),
|
||||
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 {
|
||||
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) {
|
||||
return ListView.separated(
|
||||
separatorBuilder: (BuildContext context, index) {
|
||||
return const Divider();
|
||||
return Divider(
|
||||
color: MyTheme().secondaryColor(),
|
||||
);
|
||||
},
|
||||
itemCount: widget.patients.length,
|
||||
itemBuilder: (context, index) {
|
||||
@@ -45,14 +59,21 @@ class _BuildPatientsListState extends State<BuildPatientsList> {
|
||||
return ListTile(
|
||||
title: isMainMember(index),
|
||||
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: () {
|
||||
setState(() {
|
||||
Navigator.of(context).pushNamed('/patient-manager/patient',
|
||||
arguments: widget.patients[index]);
|
||||
});
|
||||
},
|
||||
trailing: const Icon(Icons.arrow_forward),
|
||||
trailing: Icon(
|
||||
Icons.arrow_forward,
|
||||
color: MyTheme().secondaryColor(),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:patient_manager/main.dart';
|
||||
import 'package:patient_manager/theme/mihTheme.dart';
|
||||
|
||||
class HomeAppDrawer extends StatefulWidget {
|
||||
final String userEmail;
|
||||
@@ -14,21 +16,31 @@ class _HomeAppDrawerState extends State<HomeAppDrawer> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Drawer(
|
||||
backgroundColor: MyTheme().primaryColor(),
|
||||
child: ListView(
|
||||
padding: EdgeInsets.zero,
|
||||
children: [
|
||||
DrawerHeader(
|
||||
decoration: const BoxDecoration(
|
||||
color: Colors.blueAccent,
|
||||
decoration: BoxDecoration(
|
||||
color: MyTheme().secondaryColor(),
|
||||
),
|
||||
child: Text(
|
||||
widget.userEmail,
|
||||
style: TextStyle(color: MyTheme().primaryColor()),
|
||||
),
|
||||
child: Text(widget.userEmail),
|
||||
),
|
||||
ListTile(
|
||||
title: const Row(
|
||||
title: Row(
|
||||
children: [
|
||||
Icon(Icons.logout),
|
||||
Icon(
|
||||
Icons.logout,
|
||||
color: MyTheme().secondaryColor(),
|
||||
),
|
||||
SizedBox(width: 25.0),
|
||||
Text("Sign Out"),
|
||||
Text(
|
||||
"Sign Out",
|
||||
style: TextStyle(color: MyTheme().secondaryColor()),
|
||||
),
|
||||
],
|
||||
),
|
||||
onTap: () {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:patient_manager/theme/mihTheme.dart';
|
||||
|
||||
class HomeTile extends StatelessWidget {
|
||||
final String tileName;
|
||||
@@ -18,30 +19,39 @@ class HomeTile extends StatelessWidget {
|
||||
return GestureDetector(
|
||||
onTap: onTap,
|
||||
child: Card(
|
||||
color: Colors.white,
|
||||
color: MyTheme().secondaryColor(),
|
||||
elevation: 20,
|
||||
child: Column(
|
||||
//mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Expanded(
|
||||
child: ListTile(
|
||||
leading: const Icon(Icons.abc),
|
||||
leading: Icon(
|
||||
Icons.abc,
|
||||
color: MyTheme().primaryColor(),
|
||||
),
|
||||
title: Text(
|
||||
tileName,
|
||||
style: const TextStyle(
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MyTheme().primaryColor(),
|
||||
),
|
||||
),
|
||||
subtitle: Text(tileDescription),
|
||||
subtitle: Text(
|
||||
tileDescription,
|
||||
style: TextStyle(color: MyTheme().primaryColor()),
|
||||
)),
|
||||
),
|
||||
),
|
||||
const Expanded(
|
||||
Expanded(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 10),
|
||||
child: Icon(Icons.arrow_forward),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||
child: Icon(
|
||||
Icons.arrow_forward,
|
||||
color: MyTheme().secondaryColor(),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -5,6 +5,7 @@ import 'package:patient_manager/components/buildMedList.dart';
|
||||
import 'package:patient_manager/components/myErrorMessage.dart';
|
||||
import 'package:patient_manager/objects/medicine.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:patient_manager/theme/mihTheme.dart';
|
||||
|
||||
class MedicineSearch extends StatefulWidget {
|
||||
final TextEditingController searchVlaue;
|
||||
@@ -65,20 +66,20 @@ class _MedicineSearchState extends State<MedicineSearch> {
|
||||
width: 700.0,
|
||||
//height: 475.0,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
color: MyTheme().primaryColor(),
|
||||
borderRadius: BorderRadius.circular(25.0),
|
||||
border: Border.all(color: Colors.blueAccent, width: 5.0),
|
||||
border: Border.all(color: MyTheme().secondaryColor(), width: 5.0),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Text(
|
||||
Text(
|
||||
"Select Medicine",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Colors.blueAccent,
|
||||
color: MyTheme().secondaryColor(),
|
||||
fontSize: 35.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:patient_manager/theme/mihTheme.dart';
|
||||
|
||||
class MyAppBar extends StatelessWidget implements PreferredSizeWidget {
|
||||
@override
|
||||
@@ -11,9 +12,10 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppBar(
|
||||
backgroundColor: Colors.blueAccent,
|
||||
//backgroundColor: Colors.blueAccent,
|
||||
elevation: 8,
|
||||
shadowColor: Colors.black,
|
||||
shadowColor: MyTheme().secondaryColor(),
|
||||
iconTheme: IconThemeData(color: MyTheme().primaryColor()),
|
||||
// actions: [
|
||||
// IconButton(
|
||||
// onPressed: () {
|
||||
@@ -27,9 +29,9 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget {
|
||||
// ],
|
||||
title: Text(
|
||||
barTitle,
|
||||
style: const TextStyle(
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.black,
|
||||
color: MyTheme().primaryColor(),
|
||||
),
|
||||
),
|
||||
centerTitle: true,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:patient_manager/theme/mihTheme.dart';
|
||||
|
||||
class MyDateField extends StatefulWidget {
|
||||
final controller;
|
||||
@@ -40,20 +41,20 @@ class _MyDateFieldState extends State<MyDateField> {
|
||||
return Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Text(
|
||||
Text(
|
||||
"*",
|
||||
style: TextStyle(color: Colors.red),
|
||||
style: TextStyle(color: MyTheme().errorColor()),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 8.0,
|
||||
),
|
||||
Text(widget.LableText,
|
||||
style: const TextStyle(color: Colors.blueAccent)),
|
||||
style: TextStyle(color: MyTheme().secondaryColor())),
|
||||
],
|
||||
);
|
||||
} else {
|
||||
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(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 25.0),
|
||||
child: TextField(
|
||||
style: TextStyle(color: MyTheme().secondaryColor()),
|
||||
controller: widget.controller,
|
||||
readOnly: true,
|
||||
obscureText: false,
|
||||
@@ -97,25 +99,39 @@ class _MyDateFieldState extends State<MyDateField> {
|
||||
}),
|
||||
decoration: InputDecoration(
|
||||
errorText: _errorText,
|
||||
errorStyle: TextStyle(
|
||||
color: MyTheme().errorColor(), fontWeight: FontWeight.bold),
|
||||
label: setRequiredText(),
|
||||
//labelText: widget.LableText,
|
||||
//labelStyle: const TextStyle(color: Colors.blueAccent),
|
||||
prefixIcon: const Icon(
|
||||
prefixIcon: Icon(
|
||||
Icons.calendar_today,
|
||||
color: Colors.blueAccent,
|
||||
color: MyTheme().secondaryColor(),
|
||||
),
|
||||
fillColor: Colors.white,
|
||||
fillColor: MyTheme().primaryColor(),
|
||||
filled: true,
|
||||
//hintText: hintText,
|
||||
hintStyle: TextStyle(color: Colors.blueGrey[400]),
|
||||
enabledBorder: const OutlineInputBorder(
|
||||
//hintStyle: TextStyle(color: Colors.blueGrey[400]),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Colors.blueAccent,
|
||||
color: MyTheme().secondaryColor(),
|
||||
width: 2.0,
|
||||
),
|
||||
),
|
||||
focusedBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.blue),
|
||||
focusedErrorBorder: OutlineInputBorder(
|
||||
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: () {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:patient_manager/theme/mihTheme.dart';
|
||||
|
||||
class MyDropdownField extends StatefulWidget {
|
||||
final TextEditingController controller;
|
||||
@@ -32,20 +33,20 @@ class _MyDropdownFieldState extends State<MyDropdownField> {
|
||||
return Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Text(
|
||||
Text(
|
||||
"*",
|
||||
style: TextStyle(color: Colors.red),
|
||||
style: TextStyle(color: MyTheme().errorColor()),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 8.0,
|
||||
),
|
||||
Text(widget.hintText,
|
||||
style: const TextStyle(color: Colors.blueAccent)),
|
||||
style: TextStyle(color: MyTheme().secondaryColor())),
|
||||
],
|
||||
);
|
||||
} else {
|
||||
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>> menueList = [];
|
||||
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;
|
||||
}
|
||||
@@ -90,12 +96,21 @@ class _MyDropdownFieldState extends State<MyDropdownField> {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 25.0),
|
||||
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,
|
||||
controller: widget.controller,
|
||||
expandedInsets: EdgeInsets.zero,
|
||||
label: setRequiredText(),
|
||||
errorText: _errorText,
|
||||
|
||||
focusNode: _focus,
|
||||
onSelected: (_) => setState(() {
|
||||
startup = false;
|
||||
@@ -107,27 +122,44 @@ class _MyDropdownFieldState extends State<MyDropdownField> {
|
||||
});
|
||||
widget.controller.clear();
|
||||
},
|
||||
icon: const Icon(
|
||||
icon: Icon(
|
||||
Icons.delete_outline_rounded,
|
||||
color: Colors.blueAccent,
|
||||
color: MyTheme().secondaryColor(),
|
||||
),
|
||||
),
|
||||
menuStyle: const MenuStyle(
|
||||
backgroundColor: WidgetStatePropertyAll(Colors.white),
|
||||
menuStyle: MenuStyle(
|
||||
backgroundColor: WidgetStatePropertyAll(MyTheme().primaryColor()),
|
||||
side: WidgetStatePropertyAll(
|
||||
BorderSide(color: Colors.blueAccent, width: 2.0),
|
||||
BorderSide(color: MyTheme().secondaryColor(), width: 2.0),
|
||||
),
|
||||
),
|
||||
inputDecorationTheme: const InputDecorationTheme(
|
||||
|
||||
inputDecorationTheme: InputDecorationTheme(
|
||||
filled: true,
|
||||
fillColor: Colors.white,
|
||||
enabledBorder: OutlineInputBorder(
|
||||
errorStyle: TextStyle(
|
||||
color: MyTheme().errorColor(), fontWeight: FontWeight.bold),
|
||||
fillColor: MyTheme().primaryColor(),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(color: MyTheme().secondaryColor())),
|
||||
focusedErrorBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Colors.blueAccent,
|
||||
color: MyTheme().errorColor(),
|
||||
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,
|
||||
// const <DropdownMenuEntry<String>>[
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:patient_manager/theme/mihTheme.dart';
|
||||
|
||||
class MyErrorMessage extends StatefulWidget {
|
||||
final String errorType;
|
||||
@@ -22,35 +23,35 @@ class _MyErrorMessageState extends State<MyErrorMessage> {
|
||||
width: 500.0,
|
||||
height: 375.0,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
color: MyTheme().primaryColor(),
|
||||
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(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Icon(
|
||||
Icon(
|
||||
Icons.warning_amber_rounded,
|
||||
size: 100,
|
||||
color: Colors.red,
|
||||
color: MyTheme().errorColor(),
|
||||
),
|
||||
const SizedBox(height: 15),
|
||||
const Text(
|
||||
Text(
|
||||
"Oops! Looks like some fields are missing.",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Colors.red,
|
||||
color: MyTheme().errorColor(),
|
||||
fontSize: 25.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
const Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 25.0),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 25.0),
|
||||
child: 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.",
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
color: MyTheme().secondaryColor(),
|
||||
fontSize: 15.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -60,9 +61,9 @@ class _MyErrorMessageState extends State<MyErrorMessage> {
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 25.0),
|
||||
child: RichText(
|
||||
text: const TextSpan(
|
||||
text: TextSpan(
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
color: MyTheme().secondaryColor(),
|
||||
fontSize: 15.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -70,10 +71,15 @@ class _MyErrorMessageState extends State<MyErrorMessage> {
|
||||
TextSpan(
|
||||
text: "Here's a quick tip: ",
|
||||
style: TextStyle(
|
||||
fontStyle: FontStyle.italic, color: Colors.red)),
|
||||
TextSpan(text: "Look for fields with an asterisk ("),
|
||||
TextSpan(text: "*", style: TextStyle(color: Colors.red)),
|
||||
TextSpan(text: ") next to them, as these are mandatory."),
|
||||
fontStyle: FontStyle.italic,
|
||||
color: MyTheme().errorColor())),
|
||||
const TextSpan(
|
||||
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: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
icon: const Icon(
|
||||
icon: Icon(
|
||||
Icons.close,
|
||||
color: Colors.red,
|
||||
color: MyTheme().errorColor(),
|
||||
size: 35,
|
||||
),
|
||||
),
|
||||
@@ -109,60 +115,60 @@ class _MyErrorMessageState extends State<MyErrorMessage> {
|
||||
width: 500.0,
|
||||
height: 450.0,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
color: MyTheme().primaryColor(),
|
||||
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,
|
||||
children: [
|
||||
Icon(
|
||||
Icons.warning_amber_rounded,
|
||||
size: 100,
|
||||
color: Colors.red,
|
||||
color: MyTheme().errorColor(),
|
||||
),
|
||||
SizedBox(height: 15),
|
||||
Text(
|
||||
"Uh oh! Login attempt unsuccessful.",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Colors.red,
|
||||
color: MyTheme().errorColor(),
|
||||
fontSize: 25.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
const SizedBox(height: 10),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 25.0),
|
||||
child: Text(
|
||||
"The email address or password you entered doesn't seem to match our records. Please double-check your information and try again.",
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
color: MyTheme().secondaryColor(),
|
||||
fontSize: 15.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 15),
|
||||
const SizedBox(height: 15),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 25.0),
|
||||
child: Text(
|
||||
"Here are some things to keep in mind:",
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
color: MyTheme().secondaryColor(),
|
||||
fontSize: 20.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
const SizedBox(height: 10),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 25.0),
|
||||
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.",
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
color: MyTheme().secondaryColor(),
|
||||
fontSize: 15.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -180,9 +186,9 @@ class _MyErrorMessageState extends State<MyErrorMessage> {
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
icon: const Icon(
|
||||
icon: Icon(
|
||||
Icons.close,
|
||||
color: Colors.red,
|
||||
color: MyTheme().errorColor(),
|
||||
size: 35,
|
||||
),
|
||||
),
|
||||
@@ -199,60 +205,60 @@ class _MyErrorMessageState extends State<MyErrorMessage> {
|
||||
width: 500.0,
|
||||
height: 450.0,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
color: MyTheme().primaryColor(),
|
||||
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,
|
||||
children: [
|
||||
Icon(
|
||||
Icons.warning_amber_rounded,
|
||||
size: 100,
|
||||
color: Colors.red,
|
||||
color: MyTheme().errorColor(),
|
||||
),
|
||||
SizedBox(height: 15),
|
||||
const SizedBox(height: 15),
|
||||
Text(
|
||||
"Internet Connection Lost!",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Colors.red,
|
||||
color: MyTheme().errorColor(),
|
||||
fontSize: 25.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
const SizedBox(height: 10),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 25.0),
|
||||
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.",
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
color: MyTheme().secondaryColor(),
|
||||
fontSize: 15.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 15),
|
||||
const SizedBox(height: 15),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 25.0),
|
||||
child: Text(
|
||||
"Here are a few things you can try:",
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
color: MyTheme().secondaryColor(),
|
||||
fontSize: 20.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
const SizedBox(height: 10),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 25.0),
|
||||
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.",
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
color: MyTheme().secondaryColor(),
|
||||
fontSize: 15.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -270,9 +276,9 @@ class _MyErrorMessageState extends State<MyErrorMessage> {
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
icon: const Icon(
|
||||
icon: Icon(
|
||||
Icons.close,
|
||||
color: Colors.red,
|
||||
color: MyTheme().errorColor(),
|
||||
size: 35,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:patient_manager/theme/mihTheme.dart';
|
||||
|
||||
class MyMLTextField extends StatefulWidget {
|
||||
final controller;
|
||||
@@ -55,20 +56,20 @@ class _MyMLTextFieldState extends State<MyMLTextField> {
|
||||
return Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Text(
|
||||
Text(
|
||||
"*",
|
||||
style: TextStyle(color: Colors.red),
|
||||
style: TextStyle(color: MyTheme().errorColor()),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 8.0,
|
||||
),
|
||||
Text(widget.hintText,
|
||||
style: const TextStyle(color: Colors.blueAccent)),
|
||||
style: TextStyle(color: MyTheme().secondaryColor())),
|
||||
],
|
||||
);
|
||||
} else {
|
||||
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(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 25.0),
|
||||
child: TextField(
|
||||
style: TextStyle(color: MyTheme().secondaryColor()),
|
||||
textAlign: TextAlign.start,
|
||||
textAlignVertical: TextAlignVertical.top,
|
||||
expands: true,
|
||||
@@ -97,20 +99,34 @@ class _MyMLTextFieldState extends State<MyMLTextField> {
|
||||
decoration: InputDecoration(
|
||||
label: setRequiredText(),
|
||||
errorText: _errorText,
|
||||
labelStyle: const TextStyle(color: Colors.blueAccent),
|
||||
errorStyle: TextStyle(
|
||||
color: MyTheme().errorColor(), fontWeight: FontWeight.bold),
|
||||
labelStyle: TextStyle(color: MyTheme().secondaryColor()),
|
||||
alignLabelWithHint: true,
|
||||
fillColor: Colors.white,
|
||||
fillColor: MyTheme().primaryColor(),
|
||||
filled: true,
|
||||
//hintText: hintText,
|
||||
//hintStyle: TextStyle(color: Colors.blueGrey[400]),
|
||||
enabledBorder: const OutlineInputBorder(
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Colors.blueAccent,
|
||||
color: MyTheme().secondaryColor(),
|
||||
width: 2.0,
|
||||
),
|
||||
),
|
||||
focusedBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.blue),
|
||||
focusedErrorBorder: OutlineInputBorder(
|
||||
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()),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:patient_manager/theme/mihTheme.dart';
|
||||
|
||||
class MyPassField extends StatefulWidget {
|
||||
final controller;
|
||||
@@ -51,20 +52,20 @@ class _MyPassFieldState extends State<MyPassField> {
|
||||
return Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Text(
|
||||
Text(
|
||||
"*",
|
||||
style: TextStyle(color: Colors.red),
|
||||
style: TextStyle(color: MyTheme().errorColor()),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 8.0,
|
||||
),
|
||||
Text(widget.hintText,
|
||||
style: const TextStyle(color: Colors.blueAccent)),
|
||||
style: TextStyle(color: MyTheme().secondaryColor())),
|
||||
],
|
||||
);
|
||||
} else {
|
||||
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),
|
||||
child: TextField(
|
||||
controller: widget.controller,
|
||||
style: TextStyle(color: MyTheme().secondaryColor()),
|
||||
obscureText: _obscured,
|
||||
focusNode: textFieldFocusNode,
|
||||
onChanged: (_) => setState(() {
|
||||
startup = false;
|
||||
}),
|
||||
decoration: InputDecoration(
|
||||
fillColor: Colors.white,
|
||||
fillColor: MyTheme().primaryColor(),
|
||||
filled: true,
|
||||
label: setRequiredText(),
|
||||
//labelStyle: const TextStyle(color: Colors.blueAccent),
|
||||
errorText: _errorText,
|
||||
errorStyle: TextStyle(
|
||||
color: MyTheme().errorColor(), fontWeight: FontWeight.bold),
|
||||
//hintText: widget.hintText,
|
||||
//hintStyle: TextStyle(color: Colors.blueGrey[400]),
|
||||
enabledBorder: const OutlineInputBorder(
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Colors.blueAccent,
|
||||
color: MyTheme().secondaryColor(),
|
||||
width: 2.0,
|
||||
),
|
||||
),
|
||||
focusedBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.blue),
|
||||
focusedErrorBorder: OutlineInputBorder(
|
||||
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(
|
||||
padding: const EdgeInsets.fromLTRB(0, 0, 4, 0),
|
||||
@@ -117,7 +133,7 @@ class _MyPassFieldState extends State<MyPassField> {
|
||||
? Icons.visibility_rounded
|
||||
: Icons.visibility_off_rounded,
|
||||
size: 24,
|
||||
color: Colors.blue,
|
||||
color: MyTheme().secondaryColor(),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:patient_manager/theme/mihTheme.dart';
|
||||
|
||||
class MySearchField extends StatefulWidget {
|
||||
final TextEditingController controller;
|
||||
@@ -59,20 +60,24 @@ class _MySearchFieldState extends State<MySearchField> {
|
||||
return Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Text(
|
||||
Text(
|
||||
"*",
|
||||
style: TextStyle(color: Colors.red),
|
||||
style: TextStyle(color: MyTheme().errorColor()),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 8.0,
|
||||
),
|
||||
Text(widget.hintText,
|
||||
style: const TextStyle(color: Colors.blueAccent)),
|
||||
Text(
|
||||
widget.hintText,
|
||||
style: TextStyle(
|
||||
color: MyTheme().secondaryColor(),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
} else {
|
||||
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(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 25.0),
|
||||
child: TextField(
|
||||
style: TextStyle(color: MyTheme().secondaryColor()),
|
||||
onChanged: widget.onChanged,
|
||||
controller: widget.controller,
|
||||
//style: TextStyle(color: MyTheme().secondaryColor()),
|
||||
readOnly: makeEditable(),
|
||||
focusNode: _focus,
|
||||
obscureText: false,
|
||||
decoration: InputDecoration(
|
||||
fillColor: Colors.white,
|
||||
fillColor: MyTheme().primaryColor(),
|
||||
prefixIcon: IconButton(
|
||||
icon: const Icon(
|
||||
icon: Icon(
|
||||
Icons.search,
|
||||
color: Colors.blueAccent,
|
||||
color: MyTheme().secondaryColor(),
|
||||
),
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
@@ -111,14 +118,28 @@ class _MySearchFieldState extends State<MySearchField> {
|
||||
filled: true,
|
||||
label: setRequiredText(),
|
||||
errorText: _errorText,
|
||||
enabledBorder: const OutlineInputBorder(
|
||||
errorStyle: TextStyle(
|
||||
color: MyTheme().errorColor(), fontWeight: FontWeight.bold),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Colors.blueAccent,
|
||||
color: MyTheme().secondaryColor(),
|
||||
width: 2.0,
|
||||
),
|
||||
),
|
||||
focusedBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.blue),
|
||||
focusedErrorBorder: OutlineInputBorder(
|
||||
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()),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:patient_manager/components/mybutton.dart';
|
||||
import 'package:patient_manager/theme/mihTheme.dart';
|
||||
|
||||
class MySuccessMessage extends StatefulWidget {
|
||||
final String successType;
|
||||
@@ -26,24 +27,24 @@ class _MySuccessMessageState extends State<MySuccessMessage> {
|
||||
width: 500.0,
|
||||
// height: 375.0,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
color: MyTheme().primaryColor(),
|
||||
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(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Icon(
|
||||
Icon(
|
||||
Icons.check_circle_outline_rounded,
|
||||
size: 100,
|
||||
color: Colors.green,
|
||||
color: MyTheme().successColor(),
|
||||
),
|
||||
const SizedBox(height: 15),
|
||||
const Text(
|
||||
Text(
|
||||
"Success!",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Colors.green,
|
||||
color: MyTheme().successColor(),
|
||||
fontSize: 25.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -53,8 +54,8 @@ class _MySuccessMessageState extends State<MySuccessMessage> {
|
||||
padding: const EdgeInsets.symmetric(horizontal: 25.0),
|
||||
child: Text(
|
||||
message,
|
||||
style: const TextStyle(
|
||||
color: Colors.black,
|
||||
style: TextStyle(
|
||||
color: MyTheme().secondaryColor(),
|
||||
fontSize: 15.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -69,8 +70,8 @@ class _MySuccessMessageState extends State<MySuccessMessage> {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
buttonText: "Dismiss",
|
||||
buttonColor: Colors.green,
|
||||
textColor: Colors.white,
|
||||
buttonColor: MyTheme().successColor(),
|
||||
textColor: MyTheme().primaryColor(),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:patient_manager/theme/mihTheme.dart';
|
||||
|
||||
class MyTextField extends StatefulWidget {
|
||||
final controller;
|
||||
@@ -55,20 +56,20 @@ class _MyTextFieldState extends State<MyTextField> {
|
||||
return Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Text(
|
||||
Text(
|
||||
"*",
|
||||
style: TextStyle(color: Colors.red),
|
||||
style: TextStyle(color: MyTheme().errorColor()),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 8.0,
|
||||
),
|
||||
Text(widget.hintText,
|
||||
style: const TextStyle(color: Colors.blueAccent)),
|
||||
style: TextStyle(color: MyTheme().secondaryColor())),
|
||||
],
|
||||
);
|
||||
} else {
|
||||
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(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 25.0),
|
||||
child: TextField(
|
||||
style: TextStyle(color: MyTheme().secondaryColor()),
|
||||
controller: widget.controller,
|
||||
focusNode: _focus,
|
||||
readOnly: makeEditable(),
|
||||
@@ -92,20 +94,35 @@ class _MyTextFieldState extends State<MyTextField> {
|
||||
}),
|
||||
decoration: InputDecoration(
|
||||
label: setRequiredText(),
|
||||
//labelStyle: const TextStyle(color: Colors.blueAccent),
|
||||
fillColor: Colors.white,
|
||||
//labelStyle: TextStyle(color: MyTheme().primaryColor()),
|
||||
fillColor: MyTheme().primaryColor(),
|
||||
filled: true,
|
||||
errorText: _errorText,
|
||||
errorStyle: TextStyle(
|
||||
color: MyTheme().errorColor(), fontWeight: FontWeight.bold),
|
||||
//errorBorder: const InputBorder(),
|
||||
//hintText: hintText,
|
||||
//hintStyle: TextStyle(color: Colors.blueGrey[400]),
|
||||
enabledBorder: const OutlineInputBorder(
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Colors.blueAccent,
|
||||
color: MyTheme().secondaryColor(),
|
||||
width: 2.0,
|
||||
),
|
||||
),
|
||||
focusedBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.blue),
|
||||
focusedErrorBorder: OutlineInputBorder(
|
||||
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()),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -32,6 +32,7 @@ class MyButton extends StatelessWidget {
|
||||
//fontWeight: FontWeight.bold,
|
||||
fontSize: 20,
|
||||
color: textColor,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:patient_manager/main.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:patient_manager/objects/appUser.dart';
|
||||
import 'package:patient_manager/theme/mihTheme.dart';
|
||||
|
||||
class PatManAppDrawer extends StatefulWidget {
|
||||
final String userEmail;
|
||||
@@ -22,8 +23,8 @@ class _PatManAppDrawerState extends State<PatManAppDrawer> {
|
||||
//print("pat man drawer: " + endpointUserData + widget.userEmail);
|
||||
var response =
|
||||
await http.get(Uri.parse(endpointUserData + widget.userEmail));
|
||||
print(response.statusCode);
|
||||
print(response.body);
|
||||
// print(response.statusCode);
|
||||
// print(response.body);
|
||||
if (response.statusCode == 200) {
|
||||
return AppUser.fromJson(
|
||||
jsonDecode(response.body) as Map<String, dynamic>);
|
||||
@@ -44,87 +45,113 @@ class _PatManAppDrawerState extends State<PatManAppDrawer> {
|
||||
future: signedInUser,
|
||||
builder: (BuildContext context, AsyncSnapshot<AppUser> snapshot) {
|
||||
return Drawer(
|
||||
backgroundColor: MyTheme().primaryColor(),
|
||||
child: ListView(
|
||||
padding: EdgeInsets.zero,
|
||||
children: [
|
||||
DrawerHeader(
|
||||
decoration: const BoxDecoration(
|
||||
color: Colors.blueAccent,
|
||||
decoration: BoxDecoration(
|
||||
color: MyTheme().secondaryColor(),
|
||||
),
|
||||
child: SizedBox(
|
||||
height: 400,
|
||||
child: Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Text(
|
||||
Text(
|
||||
"Signed Is As:",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 20.0,
|
||||
),
|
||||
color: MyTheme().primaryColor()),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 50.0,
|
||||
),
|
||||
Expanded(
|
||||
child: Row(
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
const Text(
|
||||
Text(
|
||||
"Name: ",
|
||||
style: TextStyle(fontWeight: FontWeight.bold),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MyTheme().primaryColor(),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 15),
|
||||
Text(
|
||||
"${snapshot.data?.fname} ${snapshot.data?.lname}"),
|
||||
"${snapshot.data?.fname} ${snapshot.data?.lname}",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MyTheme().primaryColor(),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Row(
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
const Text(
|
||||
Text(
|
||||
"Email: ",
|
||||
style: TextStyle(fontWeight: FontWeight.bold),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MyTheme().primaryColor(),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
Text("${snapshot.data?.email}"),
|
||||
],
|
||||
Text(
|
||||
"${snapshot.data?.email}",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MyTheme().primaryColor(),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
title: const Expanded(
|
||||
child: Row(
|
||||
title: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Icon(Icons.home_outlined),
|
||||
SizedBox(width: 25.0),
|
||||
Text("Home"),
|
||||
],
|
||||
Icon(
|
||||
Icons.home_outlined,
|
||||
color: MyTheme().secondaryColor(),
|
||||
),
|
||||
const SizedBox(width: 25.0),
|
||||
Text(
|
||||
"Home",
|
||||
style: TextStyle(
|
||||
//fontWeight: FontWeight.bold,
|
||||
color: MyTheme().secondaryColor(),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.of(context).pushNamed('/home');
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
title: const Expanded(
|
||||
child: Row(
|
||||
title: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Icon(Icons.perm_identity),
|
||||
SizedBox(width: 25.0),
|
||||
Text("Profile"),
|
||||
],
|
||||
Icon(
|
||||
Icons.perm_identity,
|
||||
color: MyTheme().secondaryColor(),
|
||||
),
|
||||
const SizedBox(width: 25.0),
|
||||
Text(
|
||||
"Profile",
|
||||
style: TextStyle(
|
||||
//fontWeight: FontWeight.bold,
|
||||
color: MyTheme().secondaryColor(),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
onTap: () {
|
||||
//signedInUser = snapshot.data!;
|
||||
@@ -134,15 +161,22 @@ class _PatManAppDrawerState extends State<PatManAppDrawer> {
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
title: const Expanded(
|
||||
child: Row(
|
||||
title: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Icon(Icons.logout),
|
||||
SizedBox(width: 25.0),
|
||||
Text("Sign Out"),
|
||||
],
|
||||
Icon(
|
||||
Icons.logout,
|
||||
color: MyTheme().secondaryColor(),
|
||||
),
|
||||
const SizedBox(width: 25.0),
|
||||
Text(
|
||||
"Sign Out",
|
||||
style: TextStyle(
|
||||
//fontWeight: FontWeight.bold,
|
||||
color: MyTheme().secondaryColor(),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
onTap: () {
|
||||
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('/');
|
||||
// },
|
||||
// )
|
||||
// ],
|
||||
// ),
|
||||
// );
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:patient_manager/components/myTextInput.dart';
|
||||
import 'package:patient_manager/objects/patients.dart';
|
||||
import 'package:patient_manager/theme/mihTheme.dart';
|
||||
|
||||
class PatientDetails extends StatefulWidget {
|
||||
final Patient selectedPatient;
|
||||
@@ -61,9 +62,9 @@ class _PatientDetailsState extends State<PatientDetails> {
|
||||
return Container(
|
||||
padding: const EdgeInsets.only(left: 20, right: 20, bottom: 10),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
color: MyTheme().primaryColor(),
|
||||
borderRadius: BorderRadius.circular(25.0),
|
||||
border: Border.all(color: Colors.blueAccent, width: 3.0),
|
||||
border: Border.all(color: MyTheme().secondaryColor(), width: 3.0),
|
||||
),
|
||||
//constraints: const BoxConstraints.expand(height: 250.0),
|
||||
child: Column(
|
||||
@@ -72,19 +73,19 @@ class _PatientDetailsState extends State<PatientDetails> {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
//crossAxisAlignment: ,
|
||||
children: [
|
||||
const Text(
|
||||
Text(
|
||||
"Patient Details",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 25,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.blueAccent,
|
||||
color: MyTheme().secondaryColor(),
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
icon: const Icon(Icons.edit),
|
||||
alignment: Alignment.topRight,
|
||||
color: Colors.blueAccent,
|
||||
color: MyTheme().secondaryColor(),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pushNamed(
|
||||
'/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),
|
||||
Column(
|
||||
children: [
|
||||
@@ -151,16 +152,16 @@ class _PatientDetailsState extends State<PatientDetails> {
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
const Text(
|
||||
Text(
|
||||
"Medical Aid Details",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 25,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.blueAccent,
|
||||
color: MyTheme().secondaryColor(),
|
||||
),
|
||||
),
|
||||
const Divider(color: Colors.blueAccent),
|
||||
Divider(color: MyTheme().secondaryColor()),
|
||||
const SizedBox(height: 10),
|
||||
Column(
|
||||
children: [
|
||||
|
||||
@@ -15,6 +15,7 @@ import 'package:patient_manager/objects/appUser.dart';
|
||||
import 'package:patient_manager/objects/files.dart';
|
||||
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:patient_manager/theme/mihTheme.dart';
|
||||
|
||||
import '../objects/patients.dart';
|
||||
|
||||
@@ -240,18 +241,19 @@ class _PatientFilesState extends State<PatientFiles> {
|
||||
width: 700.0,
|
||||
//height: 475.0,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
color: MyTheme().primaryColor(),
|
||||
borderRadius: BorderRadius.circular(25.0),
|
||||
border: Border.all(color: Colors.blueAccent, width: 5.0),
|
||||
border:
|
||||
Border.all(color: MyTheme().secondaryColor(), width: 5.0),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Text(
|
||||
Text(
|
||||
"Create Medical Certificate",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Colors.blueAccent,
|
||||
color: MyTheme().secondaryColor(),
|
||||
fontSize: 35.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -266,6 +268,9 @@ class _PatientFilesState extends State<PatientFiles> {
|
||||
width: 300,
|
||||
height: 100,
|
||||
child: MyButton(
|
||||
buttonText: "Generate",
|
||||
buttonColor: MyTheme().secondaryColor(),
|
||||
textColor: MyTheme().primaryColor(),
|
||||
onTap: () {
|
||||
if (isMedCertFieldsFilled()) {
|
||||
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: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
icon: const Icon(
|
||||
icon: Icon(
|
||||
Icons.close,
|
||||
color: Colors.red,
|
||||
color: MyTheme().errorColor(),
|
||||
size: 35,
|
||||
),
|
||||
),
|
||||
@@ -322,20 +324,21 @@ class _PatientFilesState extends State<PatientFiles> {
|
||||
width: 900.0,
|
||||
//height: 475.0,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
color: MyTheme().primaryColor(),
|
||||
borderRadius: BorderRadius.circular(25.0),
|
||||
border: Border.all(color: Colors.blueAccent, width: 5.0),
|
||||
border:
|
||||
Border.all(color: MyTheme().secondaryColor(), width: 5.0),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Text(
|
||||
Text(
|
||||
"Create Precrition",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Colors.blueAccent,
|
||||
color: MyTheme().secondaryColor(),
|
||||
fontSize: 35.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -368,9 +371,9 @@ class _PatientFilesState extends State<PatientFiles> {
|
||||
noRepeatsController.clear();
|
||||
Navigator.pop(context);
|
||||
},
|
||||
icon: const Icon(
|
||||
icon: Icon(
|
||||
Icons.close,
|
||||
color: Colors.red,
|
||||
color: MyTheme().errorColor(),
|
||||
size: 35,
|
||||
),
|
||||
),
|
||||
@@ -393,18 +396,19 @@ class _PatientFilesState extends State<PatientFiles> {
|
||||
width: 700.0,
|
||||
//height: 475.0,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
color: MyTheme().primaryColor(),
|
||||
borderRadius: BorderRadius.circular(25.0),
|
||||
border: Border.all(color: Colors.blueAccent, width: 5.0),
|
||||
border:
|
||||
Border.all(color: MyTheme().secondaryColor(), width: 5.0),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Text(
|
||||
Text(
|
||||
"Upload File",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Colors.blueAccent,
|
||||
color: MyTheme().secondaryColor(),
|
||||
fontSize: 35.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -413,11 +417,14 @@ class _PatientFilesState extends State<PatientFiles> {
|
||||
SizedBox(
|
||||
width: 700,
|
||||
child: MyButton(
|
||||
buttonText: "Select File",
|
||||
buttonColor: MyTheme().secondaryColor(),
|
||||
textColor: MyTheme().primaryColor(),
|
||||
onTap: () async {
|
||||
FilePickerResult? result =
|
||||
await FilePicker.platform.pickFiles(
|
||||
type: FileType.custom,
|
||||
allowedExtensions: ['jpg', 'pdf'],
|
||||
allowedExtensions: ['jpg', 'png', 'pdf'],
|
||||
);
|
||||
if (result == null) return;
|
||||
final selectedFile = result.files.first;
|
||||
@@ -429,9 +436,6 @@ class _PatientFilesState extends State<PatientFiles> {
|
||||
selectedFileController.text = selectedFile.name;
|
||||
});
|
||||
},
|
||||
buttonText: "Select File",
|
||||
buttonColor: Colors.blueAccent,
|
||||
textColor: Colors.white,
|
||||
),
|
||||
),
|
||||
MyTextField(
|
||||
@@ -444,6 +448,9 @@ class _PatientFilesState extends State<PatientFiles> {
|
||||
width: 300,
|
||||
height: 100,
|
||||
child: MyButton(
|
||||
buttonText: "Add File",
|
||||
buttonColor: MyTheme().secondaryColor(),
|
||||
textColor: MyTheme().primaryColor(),
|
||||
onTap: () {
|
||||
if (isFileFieldsFilled()) {
|
||||
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: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
icon: const Icon(
|
||||
icon: Icon(
|
||||
Icons.close,
|
||||
color: Colors.red,
|
||||
color: MyTheme().errorColor(),
|
||||
size: 35,
|
||||
),
|
||||
),
|
||||
@@ -537,9 +541,10 @@ class _PatientFilesState extends State<PatientFiles> {
|
||||
child: Container(
|
||||
//height: 300.0,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
color: MyTheme().primaryColor(),
|
||||
borderRadius: BorderRadius.circular(25.0),
|
||||
border: Border.all(color: Colors.blueAccent, width: 3.0),
|
||||
border:
|
||||
Border.all(color: MyTheme().secondaryColor(), width: 3.0),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(top: 5.0),
|
||||
@@ -547,47 +552,47 @@ class _PatientFilesState extends State<PatientFiles> {
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Text(
|
||||
Text(
|
||||
"Files",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 25,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.blueAccent,
|
||||
color: MyTheme().secondaryColor(),
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
medCertPopUp();
|
||||
},
|
||||
icon: const Icon(
|
||||
icon: Icon(
|
||||
Icons.sick_outlined,
|
||||
color: Colors.blueAccent,
|
||||
color: MyTheme().secondaryColor(),
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
prescritionPopUp();
|
||||
},
|
||||
icon: const Icon(
|
||||
icon: Icon(
|
||||
Icons.medication_outlined,
|
||||
color: Colors.blueAccent,
|
||||
color: MyTheme().secondaryColor(),
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
uploudFilePopUp();
|
||||
},
|
||||
icon: const Icon(
|
||||
icon: Icon(
|
||||
Icons.add,
|
||||
color: Colors.blueAccent,
|
||||
color: MyTheme().secondaryColor(),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
const Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 20.0),
|
||||
child: Divider(color: Colors.blueAccent),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20.0),
|
||||
child: Divider(color: MyTheme().secondaryColor()),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
BuildFilesList(files: filesList),
|
||||
|
||||
@@ -9,6 +9,7 @@ import 'package:patient_manager/components/myTextInput.dart';
|
||||
import 'package:patient_manager/components/mybutton.dart';
|
||||
import 'package:patient_manager/objects/notes.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:patient_manager/theme/mihTheme.dart';
|
||||
|
||||
class PatientNotes extends StatefulWidget {
|
||||
final int patientIndex;
|
||||
@@ -109,18 +110,19 @@ class _PatientNotesState extends State<PatientNotes> {
|
||||
width: 700.0,
|
||||
//height: 500.0,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
color: MyTheme().primaryColor(),
|
||||
borderRadius: BorderRadius.circular(25.0),
|
||||
border: Border.all(color: Colors.blueAccent, width: 5.0),
|
||||
border:
|
||||
Border.all(color: MyTheme().secondaryColor(), width: 5.0),
|
||||
),
|
||||
child: Column(
|
||||
//mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
const Text(
|
||||
Text(
|
||||
"Add Note",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Colors.blueAccent,
|
||||
color: MyTheme().secondaryColor(),
|
||||
fontSize: 35.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -163,8 +165,8 @@ class _PatientNotesState extends State<PatientNotes> {
|
||||
}
|
||||
},
|
||||
buttonText: "Add Note",
|
||||
buttonColor: Colors.blueAccent,
|
||||
textColor: Colors.white,
|
||||
buttonColor: MyTheme().secondaryColor(),
|
||||
textColor: MyTheme().primaryColor(),
|
||||
),
|
||||
)
|
||||
],
|
||||
@@ -181,9 +183,9 @@ class _PatientNotesState extends State<PatientNotes> {
|
||||
titleController.clear();
|
||||
noteTextController.clear();
|
||||
},
|
||||
icon: const Icon(
|
||||
icon: Icon(
|
||||
Icons.close,
|
||||
color: Colors.red,
|
||||
color: MyTheme().errorColor(),
|
||||
size: 35,
|
||||
),
|
||||
),
|
||||
@@ -222,9 +224,10 @@ class _PatientNotesState extends State<PatientNotes> {
|
||||
child: Container(
|
||||
//height: 300.0,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
color: MyTheme().primaryColor(),
|
||||
borderRadius: BorderRadius.circular(25.0),
|
||||
border: Border.all(color: Colors.blueAccent, width: 3.0),
|
||||
border:
|
||||
Border.all(color: MyTheme().secondaryColor(), width: 3.0),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(top: 5.0),
|
||||
@@ -232,25 +235,26 @@ class _PatientNotesState extends State<PatientNotes> {
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Text(
|
||||
Text(
|
||||
"Notes",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 25,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.blueAccent),
|
||||
color: MyTheme().secondaryColor()),
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
addNotePopUp();
|
||||
},
|
||||
icon: const Icon(Icons.add, color: Colors.blueAccent),
|
||||
icon:
|
||||
Icon(Icons.add, color: MyTheme().secondaryColor()),
|
||||
)
|
||||
],
|
||||
),
|
||||
const Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 20.0),
|
||||
child: Divider(color: Colors.blueAccent),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20.0),
|
||||
child: Divider(color: MyTheme().secondaryColor()),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
BuildNotesList(notes: notesList),
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'package:patient_manager/components/myDropdownInput.dart';
|
||||
import 'package:patient_manager/components/myErrorMessage.dart';
|
||||
import 'package:patient_manager/components/mySearchInput.dart';
|
||||
import 'package:patient_manager/components/mybutton.dart';
|
||||
import 'package:patient_manager/theme/mihTheme.dart';
|
||||
|
||||
class PrescripInput extends StatefulWidget {
|
||||
final TextEditingController medicineController;
|
||||
@@ -187,6 +188,9 @@ class _PrescripInputState extends State<PrescripInput> {
|
||||
SizedBox(
|
||||
width: 300,
|
||||
child: MyButton(
|
||||
buttonText: "Add",
|
||||
buttonColor: MyTheme().secondaryColor(),
|
||||
textColor: MyTheme().primaryColor(),
|
||||
onTap: () {
|
||||
if (isFieldsFilled()) {
|
||||
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,
|
||||
height: 400,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
color: MyTheme().primaryColor(),
|
||||
borderRadius: BorderRadius.circular(25.0),
|
||||
border: Border.all(color: Colors.blueAccent, width: 3.0),
|
||||
border: Border.all(color: MyTheme().secondaryColor(), width: 3.0),
|
||||
),
|
||||
child: ListView.separated(
|
||||
separatorBuilder: (BuildContext context, int index) {
|
||||
@@ -239,14 +240,21 @@ class _PrescripInputState extends State<PrescripInput> {
|
||||
return ListTile(
|
||||
title: Text(
|
||||
getPerscTitle(index),
|
||||
style: TextStyle(
|
||||
color: MyTheme().secondaryColor(),
|
||||
),
|
||||
),
|
||||
subtitle: Text(
|
||||
getPerscSubtitle(index),
|
||||
style: TextStyle(
|
||||
color: MyTheme().secondaryColor(),
|
||||
),
|
||||
),
|
||||
//onTap: () {},
|
||||
trailing: IconButton(
|
||||
icon: const Icon(
|
||||
icon: Icon(
|
||||
Icons.delete_forever_outlined,
|
||||
color: MyTheme().primaryColor(),
|
||||
),
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
@@ -277,8 +285,8 @@ class _PrescripInputState extends State<PrescripInput> {
|
||||
// }
|
||||
},
|
||||
buttonText: "Generate",
|
||||
buttonColor: Colors.green,
|
||||
textColor: Colors.white,
|
||||
buttonColor: MyTheme().successColor(),
|
||||
textColor: MyTheme().primaryColor(),
|
||||
),
|
||||
)
|
||||
],
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:patient_manager/router/routeGenerator.dart';
|
||||
import 'package:patient_manager/theme/mihTheme.dart';
|
||||
import 'package:supabase_flutter/supabase_flutter.dart';
|
||||
|
||||
void main() async {
|
||||
@@ -19,9 +20,9 @@ class MzanziInnovationHub extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const MaterialApp(
|
||||
return MaterialApp(
|
||||
title: 'Mzansi Innovation Hub',
|
||||
themeMode: ThemeMode.system,
|
||||
theme: MyTheme().data,
|
||||
debugShowCheckedModeBanner: false,
|
||||
initialRoute: '/',
|
||||
onGenerateRoute: RouteGenerator.generateRoute,
|
||||
|
||||
@@ -2,7 +2,10 @@ import 'package:flutter/material.dart';
|
||||
import 'package:patient_manager/components/homeTileGrid.dart';
|
||||
import 'package:patient_manager/components/myAppBar.dart';
|
||||
import 'package:patient_manager/components/homeAppDrawer.dart';
|
||||
//import 'package:patient_manager/components/myErrorMessage.dart';
|
||||
//import 'package:patient_manager/components/mySuccessMessage.dart';
|
||||
import 'package:patient_manager/main.dart';
|
||||
//import 'package:patient_manager/theme/mihTheme.dart';
|
||||
|
||||
class Home extends StatefulWidget {
|
||||
//final String userEmail;
|
||||
@@ -42,6 +45,32 @@ class _HomeState extends State<Home> {
|
||||
body: HomeTileGrid(
|
||||
userEmail: useremail,
|
||||
),
|
||||
// floatingActionButtonLocation: FloatingActionButtonLocation.endTop,
|
||||
// floatingActionButton: Padding(
|
||||
// padding: const EdgeInsets.only(top: 65, right: 5),
|
||||
// child: FloatingActionButton.extended(
|
||||
// label: Text(
|
||||
// "Add Patient",
|
||||
// style: TextStyle(
|
||||
// fontWeight: FontWeight.bold,
|
||||
// color: MyTheme().primaryColor(),
|
||||
// ),
|
||||
// ),
|
||||
// //backgroundColor: Colors.blueAccent,
|
||||
// onPressed: () {
|
||||
// showDatePicker(
|
||||
// context: context,
|
||||
// initialDate: DateTime.now(),
|
||||
// firstDate: DateTime(2000),
|
||||
// lastDate: DateTime(2100),
|
||||
// );
|
||||
// },
|
||||
// icon: Icon(
|
||||
// Icons.add,
|
||||
// color: MyTheme().primaryColor(),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
);
|
||||
} else {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
|
||||
@@ -7,6 +7,7 @@ import 'package:patient_manager/components/mySuccessMessage.dart';
|
||||
import 'package:patient_manager/components/myTextInput.dart';
|
||||
import 'package:patient_manager/components/mybutton.dart';
|
||||
import 'package:patient_manager/objects/appUser.dart';
|
||||
import 'package:patient_manager/theme/mihTheme.dart';
|
||||
import '../components/myAppBar.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
|
||||
@@ -176,13 +177,13 @@ class _AddPatientState extends State<AddPatient> {
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
const Text(
|
||||
Text(
|
||||
"Personal Details",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 25.0,
|
||||
//color: Colors.blueAccent,
|
||||
color: MyTheme().secondaryColor(),
|
||||
),
|
||||
),
|
||||
Row(
|
||||
@@ -263,13 +264,13 @@ class _AddPatientState extends State<AddPatient> {
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 15.0),
|
||||
const Text(
|
||||
Text(
|
||||
"Medical Aid Details",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 25.0,
|
||||
//color: Colors.blueAccent,
|
||||
color: MyTheme().secondaryColor(),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
@@ -377,8 +378,8 @@ class _AddPatientState extends State<AddPatient> {
|
||||
}
|
||||
},
|
||||
buttonText: "Add",
|
||||
buttonColor: Colors.blueAccent,
|
||||
textColor: Colors.white,
|
||||
buttonColor: MyTheme().secondaryColor(),
|
||||
textColor: MyTheme().primaryColor(),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -7,6 +7,7 @@ import 'package:patient_manager/components/mySuccessMessage.dart';
|
||||
import 'package:patient_manager/components/myTextInput.dart';
|
||||
import 'package:patient_manager/components/mybutton.dart';
|
||||
import 'package:patient_manager/objects/appUser.dart';
|
||||
import 'package:patient_manager/theme/mihTheme.dart';
|
||||
import 'package:supabase_flutter/supabase_flutter.dart';
|
||||
import '../components/myAppBar.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
@@ -171,24 +172,25 @@ class _EditPatientState extends State<EditPatient> {
|
||||
width: 500.0,
|
||||
height: 475.0,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
color: MyTheme().primaryColor(),
|
||||
borderRadius: BorderRadius.circular(25.0),
|
||||
border: Border.all(color: Colors.blueAccent, width: 5.0),
|
||||
border:
|
||||
Border.all(color: MyTheme().secondaryColor(), width: 5.0),
|
||||
),
|
||||
child: Column(
|
||||
//mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
const Icon(
|
||||
Icon(
|
||||
Icons.warning_amber_rounded,
|
||||
size: 100,
|
||||
color: Colors.blueAccent,
|
||||
color: MyTheme().secondaryColor(),
|
||||
),
|
||||
const SizedBox(height: 15),
|
||||
const Text(
|
||||
Text(
|
||||
"Are you sure you want to delete this?",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Colors.blueAccent,
|
||||
color: MyTheme().secondaryColor(),
|
||||
fontSize: 25.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -198,35 +200,35 @@ class _EditPatientState extends State<EditPatient> {
|
||||
padding: const EdgeInsets.symmetric(horizontal: 25.0),
|
||||
child: Text(
|
||||
"This action is permanent! Deleting ${fnameController.text} ${lnameController.text} will remove him\\her from your account. You won't be able to recover it once it's gone.",
|
||||
style: const TextStyle(
|
||||
color: Colors.black,
|
||||
style: TextStyle(
|
||||
color: MyTheme().secondaryColor(),
|
||||
fontSize: 15.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 15),
|
||||
const Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 25.0),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 25.0),
|
||||
child: Text(
|
||||
"Here's what you'll be deleting:",
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
color: MyTheme().secondaryColor(),
|
||||
fontSize: 20.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
const Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 25.0),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 25.0),
|
||||
child: SizedBox(
|
||||
width: 450,
|
||||
child: Text(
|
||||
"1) Patient Profile Information.\n2) Patient Notes\n3) Patient Files.",
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
color: MyTheme().secondaryColor(),
|
||||
fontSize: 15.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -239,8 +241,8 @@ class _EditPatientState extends State<EditPatient> {
|
||||
child: MyButton(
|
||||
onTap: deletePatientApiCall,
|
||||
buttonText: "Delete",
|
||||
buttonColor: Colors.blueAccent,
|
||||
textColor: Colors.white,
|
||||
buttonColor: MyTheme().secondaryColor(),
|
||||
textColor: MyTheme().primaryColor(),
|
||||
))
|
||||
],
|
||||
),
|
||||
@@ -254,9 +256,9 @@ class _EditPatientState extends State<EditPatient> {
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
icon: const Icon(
|
||||
icon: Icon(
|
||||
Icons.close,
|
||||
color: Colors.red,
|
||||
color: MyTheme().errorColor(),
|
||||
size: 35,
|
||||
),
|
||||
),
|
||||
@@ -334,17 +336,18 @@ class _EditPatientState extends State<EditPatient> {
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Text(
|
||||
Text(
|
||||
"Personal Details",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 25.0,
|
||||
//color: Colors.blueAccent,
|
||||
color: MyTheme().secondaryColor(),
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
icon: const Icon(Icons.delete),
|
||||
color: MyTheme().secondaryColor(),
|
||||
alignment: Alignment.topRight,
|
||||
onPressed: () {
|
||||
deletePatientPopUp();
|
||||
@@ -430,13 +433,13 @@ class _EditPatientState extends State<EditPatient> {
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 15.0),
|
||||
const Text(
|
||||
Text(
|
||||
"Medical Aid Details",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 25.0,
|
||||
//color: Colors.blueAccent,
|
||||
color: MyTheme().secondaryColor(),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
@@ -544,8 +547,8 @@ class _EditPatientState extends State<EditPatient> {
|
||||
}
|
||||
},
|
||||
buttonText: "Update",
|
||||
buttonColor: Colors.blueAccent,
|
||||
textColor: Colors.white,
|
||||
buttonColor: MyTheme().secondaryColor(),
|
||||
textColor: MyTheme().primaryColor(),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -8,6 +8,7 @@ import 'package:http/http.dart' as http;
|
||||
import 'package:patient_manager/components/mySearchInput.dart';
|
||||
import 'package:patient_manager/components/patManAppDrawer.dart';
|
||||
import 'package:patient_manager/objects/patients.dart';
|
||||
import 'package:patient_manager/theme/mihTheme.dart';
|
||||
|
||||
class PatientManager extends StatefulWidget {
|
||||
final String userEmail;
|
||||
@@ -72,9 +73,12 @@ class _PatientManagerState extends State<PatientManager> {
|
||||
child: Container(
|
||||
height: 500,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
color: MyTheme().primaryColor(),
|
||||
borderRadius: BorderRadius.circular(25.0),
|
||||
border: Border.all(color: Colors.blueAccent, width: 3.0),
|
||||
border: Border.all(
|
||||
color: MyTheme().secondaryColor(),
|
||||
width: 3.0,
|
||||
),
|
||||
),
|
||||
child: BuildPatientsList(
|
||||
patients: patientsList,
|
||||
@@ -92,14 +96,14 @@ class _PatientManagerState extends State<PatientManager> {
|
||||
child: Container(
|
||||
height: 500,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
color: MyTheme().primaryColor(),
|
||||
borderRadius: BorderRadius.circular(25.0),
|
||||
border: Border.all(color: Colors.blueAccent, width: 3.0),
|
||||
border: Border.all(color: MyTheme().secondaryColor(), width: 3.0),
|
||||
),
|
||||
child: const Center(
|
||||
child: Center(
|
||||
child: Text(
|
||||
"Enter ID or Medical Aid No. of Patient",
|
||||
style: TextStyle(fontSize: 25, color: Colors.grey),
|
||||
style: TextStyle(fontSize: 25, color: MyTheme().messageTextColor()),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
@@ -173,21 +177,21 @@ class _PatientManagerState extends State<PatientManager> {
|
||||
floatingActionButton: Padding(
|
||||
padding: const EdgeInsets.only(top: 65, right: 5),
|
||||
child: FloatingActionButton.extended(
|
||||
label: const Text(
|
||||
label: Text(
|
||||
"Add Patient",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.white,
|
||||
color: MyTheme().primaryColor(),
|
||||
),
|
||||
),
|
||||
backgroundColor: Colors.blueAccent,
|
||||
//backgroundColor: Colors.blueAccent,
|
||||
onPressed: () {
|
||||
Navigator.of(context)
|
||||
.pushNamed('/patient-manager/add', arguments: widget.userEmail);
|
||||
},
|
||||
icon: const Icon(
|
||||
icon: Icon(
|
||||
Icons.add,
|
||||
color: Colors.white,
|
||||
color: MyTheme().primaryColor(),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -32,7 +32,7 @@ class _PatientViewState extends State<PatientView> {
|
||||
PatientNotes(
|
||||
patientIndex: widget.selectedPatient.idpatients,
|
||||
),
|
||||
SizedBox(
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
PatientFiles(
|
||||
|
||||
@@ -3,6 +3,7 @@ import 'package:patient_manager/components/myPassInput.dart';
|
||||
import 'package:patient_manager/components/myTextInput.dart';
|
||||
import 'package:patient_manager/components/mybutton.dart';
|
||||
import 'package:patient_manager/main.dart';
|
||||
import 'package:patient_manager/theme/mihTheme.dart';
|
||||
import 'package:supabase_auth_ui/supabase_auth_ui.dart';
|
||||
|
||||
class Register extends StatefulWidget {
|
||||
@@ -62,7 +63,7 @@ class _RegisterState extends State<Register> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
//backgroundColor: Colors.white,
|
||||
body: SafeArea(
|
||||
child: Center(
|
||||
child: SingleChildScrollView(
|
||||
@@ -71,20 +72,20 @@ class _RegisterState extends State<Register> {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
//logo
|
||||
const Icon(
|
||||
Icon(
|
||||
Icons.lock,
|
||||
size: 100,
|
||||
color: Colors.blueAccent,
|
||||
color: MyTheme().secondaryColor(),
|
||||
),
|
||||
//spacer
|
||||
const SizedBox(height: 10),
|
||||
//Heading
|
||||
const Text(
|
||||
Text(
|
||||
'Register',
|
||||
style: TextStyle(
|
||||
fontSize: 25,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.blueAccent,
|
||||
color: MyTheme().secondaryColor(),
|
||||
),
|
||||
),
|
||||
//spacer
|
||||
@@ -135,38 +136,23 @@ class _RegisterState extends State<Register> {
|
||||
),
|
||||
//spacer
|
||||
const SizedBox(height: 10),
|
||||
// forgot password
|
||||
const Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 25.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
Text(
|
||||
'Forgot Password?',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
//spacer
|
||||
const SizedBox(height: 30),
|
||||
// sign up button
|
||||
SizedBox(
|
||||
width: 500.0,
|
||||
height: 100.0,
|
||||
child: MyButton(
|
||||
onTap: () {},
|
||||
buttonText: "Sign Up",
|
||||
buttonColor: Colors.blueAccent,
|
||||
textColor: Colors.white,
|
||||
buttonColor: MyTheme().secondaryColor(),
|
||||
textColor: MyTheme().primaryColor(),
|
||||
),
|
||||
),
|
||||
//spacer
|
||||
const SizedBox(height: 30),
|
||||
//register text
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
SizedBox(
|
||||
width: 450.0,
|
||||
height: 100.0,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
const Text(
|
||||
'Already a User?',
|
||||
@@ -177,16 +163,17 @@ class _RegisterState extends State<Register> {
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: widget.onTap,
|
||||
child: const Text(
|
||||
child: Text(
|
||||
'Sign In',
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
color: Colors.blueAccent,
|
||||
color: MyTheme().secondaryColor(),
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'package:patient_manager/components/myPassInput.dart';
|
||||
import 'package:patient_manager/components/myTextInput.dart';
|
||||
import 'package:patient_manager/components/mybutton.dart';
|
||||
import 'package:patient_manager/main.dart';
|
||||
import 'package:patient_manager/theme/mihTheme.dart';
|
||||
import 'package:supabase_auth_ui/supabase_auth_ui.dart';
|
||||
|
||||
class SignIn extends StatefulWidget {
|
||||
@@ -52,7 +53,7 @@ class _SignInState extends State<SignIn> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
//backgroundColor: Colors.white,
|
||||
body: SafeArea(
|
||||
child: Center(
|
||||
child: SingleChildScrollView(
|
||||
@@ -61,20 +62,20 @@ class _SignInState extends State<SignIn> {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
//logo
|
||||
const Icon(
|
||||
Icon(
|
||||
Icons.lock,
|
||||
size: 100,
|
||||
color: Colors.blueAccent,
|
||||
color: MyTheme().secondaryColor(),
|
||||
),
|
||||
//spacer
|
||||
const SizedBox(height: 10),
|
||||
//Heading
|
||||
const Text(
|
||||
Text(
|
||||
'Sign In',
|
||||
style: TextStyle(
|
||||
fontSize: 25,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.blueAccent,
|
||||
color: MyTheme().secondaryColor(),
|
||||
),
|
||||
),
|
||||
//spacer
|
||||
@@ -107,6 +108,9 @@ class _SignInState extends State<SignIn> {
|
||||
width: 500.0,
|
||||
height: 100.0,
|
||||
child: MyButton(
|
||||
buttonText: "Sign In",
|
||||
buttonColor: MyTheme().secondaryColor(),
|
||||
textColor: MyTheme().primaryColor(),
|
||||
onTap: () {
|
||||
if (emailController.text.isEmpty ||
|
||||
passwordController.text.isEmpty) {
|
||||
@@ -125,36 +129,39 @@ class _SignInState extends State<SignIn> {
|
||||
Navigator.of(context).pushNamed('/homme');
|
||||
}
|
||||
},
|
||||
buttonText: "Sign In",
|
||||
buttonColor: Colors.blueAccent,
|
||||
textColor: Colors.white,
|
||||
),
|
||||
),
|
||||
//spacer
|
||||
const SizedBox(height: 30),
|
||||
//const SizedBox(height: 30),
|
||||
//register text
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
SizedBox(
|
||||
width: 450.0,
|
||||
height: 100.0,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
const Text(
|
||||
'New User?',
|
||||
style: TextStyle(fontSize: 18, color: Colors.grey),
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
color: Color.fromARGB(255, 201, 200, 200)),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 6,
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: widget.onTap,
|
||||
child: const Text(
|
||||
child: Text(
|
||||
'Register Now',
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
color: Colors.blueAccent,
|
||||
color: MyTheme().secondaryColor(),
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
|
||||
@@ -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.
Binary file not shown.
Reference in New Issue
Block a user