diff --git a/Frontend/patient_manager/lib/components/buildFilesList.dart b/Frontend/patient_manager/lib/components/buildFilesList.dart index d0602b63..6f7d9a8f 100644 --- a/Frontend/patient_manager/lib/components/buildFilesList.dart +++ b/Frontend/patient_manager/lib/components/buildFilesList.dart @@ -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 { void viewFilePopUp(String filename) { showDialog( context: context, + barrierDismissible: false, builder: (context) => Dialog( child: Stack( children: [ @@ -30,9 +32,10 @@ class _BuildFilesListState extends State { 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 { 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 { '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 { 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 { 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); }, diff --git a/Frontend/patient_manager/lib/components/buildMedList.dart b/Frontend/patient_manager/lib/components/buildMedList.dart index 0c6151ff..da733c80 100644 --- a/Frontend/patient_manager/lib/components/buildMedList.dart +++ b/Frontend/patient_manager/lib/components/buildMedList.dart @@ -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 { 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 { Navigator.of(context).pop(); }); }, - trailing: const Icon(Icons.arrow_forward), + trailing: Icon( + Icons.arrow_forward, + color: MyTheme().secondaryColor(), + ), ); }, ); diff --git a/Frontend/patient_manager/lib/components/buildNotesList.dart b/Frontend/patient_manager/lib/components/buildNotesList.dart index 2910bef9..3eaea39d 100644 --- a/Frontend/patient_manager/lib/components/buildNotesList.dart +++ b/Frontend/patient_manager/lib/components/buildNotesList.dart @@ -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 notes; @@ -24,6 +25,7 @@ class _BuildNotesListState extends State { }); showDialog( context: context, + barrierDismissible: false, builder: (context) => Dialog( child: Stack( children: [ @@ -32,9 +34,10 @@ class _BuildNotesListState extends State { 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 { 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 { 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 { 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}"); diff --git a/Frontend/patient_manager/lib/components/buildPatientList.dart b/Frontend/patient_manager/lib/components/buildPatientList.dart index 60db4301..c4d7e732 100644 --- a/Frontend/patient_manager/lib/components/buildPatientList.dart +++ b/Frontend/patient_manager/lib/components/buildPatientList.dart @@ -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 patients; @@ -21,14 +22,25 @@ class _BuildPatientsListState extends State { 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 { 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 { 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(), + ), ); }, ); diff --git a/Frontend/patient_manager/lib/components/homeAppDrawer.dart b/Frontend/patient_manager/lib/components/homeAppDrawer.dart index 8ec3ae66..35a8fd6c 100644 --- a/Frontend/patient_manager/lib/components/homeAppDrawer.dart +++ b/Frontend/patient_manager/lib/components/homeAppDrawer.dart @@ -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 { @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: () { diff --git a/Frontend/patient_manager/lib/components/homeTile.dart b/Frontend/patient_manager/lib/components/homeTile.dart index e7eb56d8..ebd989ae 100644 --- a/Frontend/patient_manager/lib/components/homeTile.dart +++ b/Frontend/patient_manager/lib/components/homeTile.dart @@ -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), - title: Text( - tileName, - style: const TextStyle( - fontWeight: FontWeight.bold, + leading: Icon( + Icons.abc, + color: MyTheme().primaryColor(), ), - ), - subtitle: Text(tileDescription), - ), + title: Text( + tileName, + style: TextStyle( + fontWeight: FontWeight.bold, + color: MyTheme().primaryColor(), + ), + ), + 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(), + ), ), ], ), diff --git a/Frontend/patient_manager/lib/components/medicineSearch.dart b/Frontend/patient_manager/lib/components/medicineSearch.dart index 16019287..a8be896e 100644 --- a/Frontend/patient_manager/lib/components/medicineSearch.dart +++ b/Frontend/patient_manager/lib/components/medicineSearch.dart @@ -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 { 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, ), diff --git a/Frontend/patient_manager/lib/components/myAppBar.dart b/Frontend/patient_manager/lib/components/myAppBar.dart index bd3d6177..30779a9e 100644 --- a/Frontend/patient_manager/lib/components/myAppBar.dart +++ b/Frontend/patient_manager/lib/components/myAppBar.dart @@ -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, diff --git a/Frontend/patient_manager/lib/components/myDateInput.dart b/Frontend/patient_manager/lib/components/myDateInput.dart index 348726bd..3736d709 100644 --- a/Frontend/patient_manager/lib/components/myDateInput.dart +++ b/Frontend/patient_manager/lib/components/myDateInput.dart @@ -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 { 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 { 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 { }), 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: () { diff --git a/Frontend/patient_manager/lib/components/myDropdownInput.dart b/Frontend/patient_manager/lib/components/myDropdownInput.dart index 065aea86..0a76e769 100644 --- a/Frontend/patient_manager/lib/components/myDropdownInput.dart +++ b/Frontend/patient_manager/lib/components/myDropdownInput.dart @@ -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 { 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 { List> buidMenueOptions(List options) { List> 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 { 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 { }); 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 >[ diff --git a/Frontend/patient_manager/lib/components/myErrorMessage.dart b/Frontend/patient_manager/lib/components/myErrorMessage.dart index 6bdbff1f..3f2be2a7 100644 --- a/Frontend/patient_manager/lib/components/myErrorMessage.dart +++ b/Frontend/patient_manager/lib/components/myErrorMessage.dart @@ -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 { 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 { 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 { 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 { 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 { 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 { 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 { 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 { onPressed: () { Navigator.pop(context); }, - icon: const Icon( + icon: Icon( Icons.close, - color: Colors.red, + color: MyTheme().errorColor(), size: 35, ), ), diff --git a/Frontend/patient_manager/lib/components/myMLTextInput.dart b/Frontend/patient_manager/lib/components/myMLTextInput.dart index fe961129..fac7c4d8 100644 --- a/Frontend/patient_manager/lib/components/myMLTextInput.dart +++ b/Frontend/patient_manager/lib/components/myMLTextInput.dart @@ -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 { 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 { 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 { 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()), ), ), ), diff --git a/Frontend/patient_manager/lib/components/myPassInput.dart b/Frontend/patient_manager/lib/components/myPassInput.dart index a35d24f8..c23a976d 100644 --- a/Frontend/patient_manager/lib/components/myPassInput.dart +++ b/Frontend/patient_manager/lib/components/myPassInput.dart @@ -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 { 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 { 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 { ? Icons.visibility_rounded : Icons.visibility_off_rounded, size: 24, - color: Colors.blue, + color: MyTheme().secondaryColor(), ), ), ), diff --git a/Frontend/patient_manager/lib/components/mySearchInput.dart b/Frontend/patient_manager/lib/components/mySearchInput.dart index 0f9c277d..98257500 100644 --- a/Frontend/patient_manager/lib/components/mySearchInput.dart +++ b/Frontend/patient_manager/lib/components/mySearchInput.dart @@ -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 { 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 { 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 { 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()), ), ), ), diff --git a/Frontend/patient_manager/lib/components/mySuccessMessage.dart b/Frontend/patient_manager/lib/components/mySuccessMessage.dart index d0488d6d..7176abef 100644 --- a/Frontend/patient_manager/lib/components/mySuccessMessage.dart +++ b/Frontend/patient_manager/lib/components/mySuccessMessage.dart @@ -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 { 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 { 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 { Navigator.pop(context); }, buttonText: "Dismiss", - buttonColor: Colors.green, - textColor: Colors.white, + buttonColor: MyTheme().successColor(), + textColor: MyTheme().primaryColor(), ), ), ], diff --git a/Frontend/patient_manager/lib/components/myTextInput.dart b/Frontend/patient_manager/lib/components/myTextInput.dart index e4efcce8..2cc38f5d 100644 --- a/Frontend/patient_manager/lib/components/myTextInput.dart +++ b/Frontend/patient_manager/lib/components/myTextInput.dart @@ -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 { 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 { 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 { }), 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()), ), ), ), diff --git a/Frontend/patient_manager/lib/components/mybutton.dart b/Frontend/patient_manager/lib/components/mybutton.dart index 7723e6e3..21c73840 100644 --- a/Frontend/patient_manager/lib/components/mybutton.dart +++ b/Frontend/patient_manager/lib/components/mybutton.dart @@ -32,6 +32,7 @@ class MyButton extends StatelessWidget { //fontWeight: FontWeight.bold, fontSize: 20, color: textColor, + fontWeight: FontWeight.bold, ), ), ), diff --git a/Frontend/patient_manager/lib/components/patManAppDrawer.dart b/Frontend/patient_manager/lib/components/patManAppDrawer.dart index fa54225b..2e03386a 100644 --- a/Frontend/patient_manager/lib/components/patManAppDrawer.dart +++ b/Frontend/patient_manager/lib/components/patManAppDrawer.dart @@ -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 { //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); @@ -44,87 +45,113 @@ class _PatManAppDrawerState extends State { future: signedInUser, builder: (BuildContext context, AsyncSnapshot 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( - "Signed Is As:", - style: TextStyle( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Text( + "Signed Is As:", + style: TextStyle( fontWeight: FontWeight.bold, 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( - height: 50.0, - ), - Expanded( - child: Row( - mainAxisSize: MainAxisSize.max, - children: [ - const Text( - "Name: ", - style: TextStyle(fontWeight: FontWeight.bold), - ), - const SizedBox(width: 15), - Text( - "${snapshot.data?.fname} ${snapshot.data?.lname}"), - ], + const SizedBox(width: 15), + Text( + "${snapshot.data?.fname} ${snapshot.data?.lname}", + style: TextStyle( + fontWeight: FontWeight.bold, + color: MyTheme().primaryColor(), + ), ), - ), - Expanded( - child: Row( - mainAxisSize: MainAxisSize.max, - children: [ - const Text( - "Email: ", - style: TextStyle(fontWeight: FontWeight.bold), - ), - const SizedBox(width: 16), - Text("${snapshot.data?.email}"), - ], + ], + ), + Row( + mainAxisSize: MainAxisSize.max, + children: [ + Text( + "Email: ", + style: TextStyle( + fontWeight: FontWeight.bold, + color: MyTheme().primaryColor(), + ), ), - ), - ], - ), + const SizedBox(width: 16), + Text( + "${snapshot.data?.email}", + style: TextStyle( + fontWeight: FontWeight.bold, + color: MyTheme().primaryColor(), + ), + ), + ], + ), + ], ), ), ), ListTile( - title: const Expanded( - child: Row( - mainAxisSize: MainAxisSize.max, - children: [ - Icon(Icons.home_outlined), - SizedBox(width: 25.0), - Text("Home"), - ], - ), + title: Row( + mainAxisSize: MainAxisSize.max, + children: [ + 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( - mainAxisSize: MainAxisSize.max, - children: [ - Icon(Icons.perm_identity), - SizedBox(width: 25.0), - Text("Profile"), - ], - ), + title: Row( + mainAxisSize: MainAxisSize.max, + children: [ + 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 { }, ), ListTile( - title: const Expanded( - child: Row( - mainAxisSize: MainAxisSize.max, - children: [ - Icon(Icons.logout), - SizedBox(width: 25.0), - Text("Sign Out"), - ], - ), + title: Row( + mainAxisSize: MainAxisSize.max, + children: [ + 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 { }, ); } - - // 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('/'); - // }, - // ) - // ], - // ), - // ); } diff --git a/Frontend/patient_manager/lib/components/patientDetails.dart b/Frontend/patient_manager/lib/components/patientDetails.dart index 2d86dd30..d2c5e71e 100644 --- a/Frontend/patient_manager/lib/components/patientDetails.dart +++ b/Frontend/patient_manager/lib/components/patientDetails.dart @@ -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 { 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 { 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 { ) ], ), - const Divider(color: Colors.blueAccent), + Divider(color: MyTheme().secondaryColor()), const SizedBox(height: 10), Column( children: [ @@ -151,16 +152,16 @@ class _PatientDetailsState extends State { ], ), 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: [ diff --git a/Frontend/patient_manager/lib/components/patientFiles.dart b/Frontend/patient_manager/lib/components/patientFiles.dart index e9f7dfb5..d0efacc6 100644 --- a/Frontend/patient_manager/lib/components/patientFiles.dart +++ b/Frontend/patient_manager/lib/components/patientFiles.dart @@ -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 { 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 { 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 { ); } }, - buttonText: "Generate", - buttonColor: Colors.blueAccent, - textColor: Colors.white, ), ) ], @@ -297,9 +299,9 @@ class _PatientFilesState extends State { 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 { 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 { 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 { 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 { 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 { selectedFileController.text = selectedFile.name; }); }, - buttonText: "Select File", - buttonColor: Colors.blueAccent, - textColor: Colors.white, ), ), MyTextField( @@ -444,6 +448,9 @@ class _PatientFilesState extends State { 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 { ); } }, - buttonText: "Add File", - buttonColor: Colors.blueAccent, - textColor: Colors.white, ), ) ], @@ -475,9 +479,9 @@ class _PatientFilesState extends State { 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 { 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 { 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), diff --git a/Frontend/patient_manager/lib/components/patientNotes.dart b/Frontend/patient_manager/lib/components/patientNotes.dart index abdb0bd5..d9e348de 100644 --- a/Frontend/patient_manager/lib/components/patientNotes.dart +++ b/Frontend/patient_manager/lib/components/patientNotes.dart @@ -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 { 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 { } }, buttonText: "Add Note", - buttonColor: Colors.blueAccent, - textColor: Colors.white, + buttonColor: MyTheme().secondaryColor(), + textColor: MyTheme().primaryColor(), ), ) ], @@ -181,9 +183,9 @@ class _PatientNotesState extends State { 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 { 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 { 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), diff --git a/Frontend/patient_manager/lib/components/prescipInput.dart b/Frontend/patient_manager/lib/components/prescipInput.dart index 2f05c95c..6dfa08d2 100644 --- a/Frontend/patient_manager/lib/components/prescipInput.dart +++ b/Frontend/patient_manager/lib/components/prescipInput.dart @@ -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 { 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 { ); } }, - buttonText: "Add", - buttonColor: Colors.blueAccent, - textColor: Colors.white, ), ) ], @@ -225,9 +226,9 @@ class _PrescripInputState extends State { 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 { 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 { // } }, buttonText: "Generate", - buttonColor: Colors.green, - textColor: Colors.white, + buttonColor: MyTheme().successColor(), + textColor: MyTheme().primaryColor(), ), ) ], diff --git a/Frontend/patient_manager/lib/main.dart b/Frontend/patient_manager/lib/main.dart index fde87ca6..b4938253 100644 --- a/Frontend/patient_manager/lib/main.dart +++ b/Frontend/patient_manager/lib/main.dart @@ -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, diff --git a/Frontend/patient_manager/lib/pages/home.dart b/Frontend/patient_manager/lib/pages/home.dart index 2605944a..b62ee723 100644 --- a/Frontend/patient_manager/lib/pages/home.dart +++ b/Frontend/patient_manager/lib/pages/home.dart @@ -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 { 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()); diff --git a/Frontend/patient_manager/lib/pages/patientAdd.dart b/Frontend/patient_manager/lib/pages/patientAdd.dart index 404182fe..bf0964a6 100644 --- a/Frontend/patient_manager/lib/pages/patientAdd.dart +++ b/Frontend/patient_manager/lib/pages/patientAdd.dart @@ -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 { 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 { ], ), 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 { } }, buttonText: "Add", - buttonColor: Colors.blueAccent, - textColor: Colors.white, + buttonColor: MyTheme().secondaryColor(), + textColor: MyTheme().primaryColor(), ), ), ], diff --git a/Frontend/patient_manager/lib/pages/patientEdit.dart b/Frontend/patient_manager/lib/pages/patientEdit.dart index 4b91f428..aa82317c 100644 --- a/Frontend/patient_manager/lib/pages/patientEdit.dart +++ b/Frontend/patient_manager/lib/pages/patientEdit.dart @@ -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 { 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 { 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 { 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 { 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 { 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 { ], ), 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 { } }, buttonText: "Update", - buttonColor: Colors.blueAccent, - textColor: Colors.white, + buttonColor: MyTheme().secondaryColor(), + textColor: MyTheme().primaryColor(), ), ), ], diff --git a/Frontend/patient_manager/lib/pages/patientManager.dart b/Frontend/patient_manager/lib/pages/patientManager.dart index 5de422bf..c83e83bf 100644 --- a/Frontend/patient_manager/lib/pages/patientManager.dart +++ b/Frontend/patient_manager/lib/pages/patientManager.dart @@ -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 { 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 { 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 { 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(), ), ), ), diff --git a/Frontend/patient_manager/lib/pages/patientView.dart b/Frontend/patient_manager/lib/pages/patientView.dart index 5e637bff..16be9e01 100644 --- a/Frontend/patient_manager/lib/pages/patientView.dart +++ b/Frontend/patient_manager/lib/pages/patientView.dart @@ -32,7 +32,7 @@ class _PatientViewState extends State { PatientNotes( patientIndex: widget.selectedPatient.idpatients, ), - SizedBox( + const SizedBox( width: 10, ), PatientFiles( diff --git a/Frontend/patient_manager/lib/pages/register.dart b/Frontend/patient_manager/lib/pages/register.dart index 5c30024e..70d9ae0b 100644 --- a/Frontend/patient_manager/lib/pages/register.dart +++ b/Frontend/patient_manager/lib/pages/register.dart @@ -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 { @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 { mainAxisAlignment: MainAxisAlignment.center, children: [ //logo - const Icon( + Icon( Icons.lock, size: 100, - color: Colors.blueAccent, + color: MyTheme().secondaryColor(), ), //spacer const SizedBox(height: 10), //Heading - const Text( + Text( 'Register', style: TextStyle( fontSize: 25, fontWeight: FontWeight.bold, - color: Colors.blueAccent, + color: MyTheme().secondaryColor(), ), ), //spacer @@ -135,58 +136,44 @@ class _RegisterState extends State { ), //spacer const SizedBox(height: 10), - // forgot password - const Padding( - padding: EdgeInsets.symmetric(horizontal: 25.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Text( - 'Forgot Password?', - style: TextStyle( - color: Colors.white, - ), - ), - ], - ), - ), - //spacer - const SizedBox(height: 30), // sign up button SizedBox( width: 500.0, + height: 100.0, child: MyButton( onTap: () {}, buttonText: "Sign Up", - buttonColor: Colors.blueAccent, - textColor: Colors.white, + buttonColor: MyTheme().secondaryColor(), + textColor: MyTheme().primaryColor(), ), ), - //spacer - const SizedBox(height: 30), //register text - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - const Text( - 'Already a User?', - style: TextStyle(fontSize: 18, color: Colors.grey), - ), - const SizedBox( - width: 6, - ), - GestureDetector( - onTap: widget.onTap, - child: const Text( - 'Sign In', - style: TextStyle( - fontSize: 18, - color: Colors.blueAccent, - fontWeight: FontWeight.bold, - ), + SizedBox( + width: 450.0, + height: 100.0, + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + const Text( + 'Already a User?', + style: TextStyle(fontSize: 18, color: Colors.grey), ), - ) - ], + const SizedBox( + width: 6, + ), + GestureDetector( + onTap: widget.onTap, + child: Text( + 'Sign In', + style: TextStyle( + fontSize: 18, + color: MyTheme().secondaryColor(), + fontWeight: FontWeight.bold, + ), + ), + ) + ], + ), ) ], ), diff --git a/Frontend/patient_manager/lib/pages/signin.dart b/Frontend/patient_manager/lib/pages/signin.dart index 4b64d3d9..79f32fd4 100644 --- a/Frontend/patient_manager/lib/pages/signin.dart +++ b/Frontend/patient_manager/lib/pages/signin.dart @@ -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 { @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 { 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 { 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 { Navigator.of(context).pushNamed('/homme'); } }, - buttonText: "Sign In", - buttonColor: Colors.blueAccent, - textColor: Colors.white, ), ), //spacer - const SizedBox(height: 30), + //const SizedBox(height: 30), //register text - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - const Text( - 'New User?', - style: TextStyle(fontSize: 18, color: Colors.grey), - ), - const SizedBox( - width: 6, - ), - GestureDetector( - onTap: widget.onTap, - child: const Text( - 'Register Now', + SizedBox( + width: 450.0, + height: 100.0, + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + const Text( + 'New User?', style: TextStyle( - fontSize: 18, - color: Colors.blueAccent, - fontWeight: FontWeight.bold, - ), + fontSize: 18, + color: Color.fromARGB(255, 201, 200, 200)), ), - ) - ], + const SizedBox( + width: 6, + ), + GestureDetector( + onTap: widget.onTap, + child: Text( + 'Register Now', + style: TextStyle( + fontSize: 18, + color: MyTheme().secondaryColor(), + fontWeight: FontWeight.bold, + ), + ), + ) + ], + ), ) ], ), diff --git a/Frontend/patient_manager/lib/theme/mihTheme.dart b/Frontend/patient_manager/lib/theme/mihTheme.dart index e69de29b..7fc3d794 100644 --- a/Frontend/patient_manager/lib/theme/mihTheme.dart +++ b/Frontend/patient_manager/lib/theme/mihTheme.dart @@ -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); + } +} diff --git a/database/#ib_16384_0.dblwr b/database/#ib_16384_0.dblwr index 93fb184a..12d8f6b6 100644 Binary files a/database/#ib_16384_0.dblwr and b/database/#ib_16384_0.dblwr differ diff --git a/database/#innodb_redo/#ib_redo18 b/database/#innodb_redo/#ib_redo18 index 2e156b66..5410417a 100644 Binary files a/database/#innodb_redo/#ib_redo18 and b/database/#innodb_redo/#ib_redo18 differ diff --git a/database/binlog.000056 b/database/binlog.000056 index a585d9aa..2afe789f 100644 Binary files a/database/binlog.000056 and b/database/binlog.000056 differ diff --git a/database/ibdata1 b/database/ibdata1 index 83c82d56..56a1be4e 100644 Binary files a/database/ibdata1 and b/database/ibdata1 differ diff --git a/database/mysql.ibd b/database/mysql.ibd index 058a85cf..9ffc5139 100644 Binary files a/database/mysql.ibd and b/database/mysql.ibd differ diff --git a/database/patient_manager/patient_notes.ibd b/database/patient_manager/patient_notes.ibd index 3553490f..67830d8e 100644 Binary files a/database/patient_manager/patient_notes.ibd and b/database/patient_manager/patient_notes.ibd differ diff --git a/database/undo_001 b/database/undo_001 index 3f239df9..452e65e8 100644 Binary files a/database/undo_001 and b/database/undo_001 differ