From 7a6ba04220fb7c0c87e0f7fa36a09497a6f2a726 Mon Sep 17 00:00:00 2001 From: yaso-meth Date: Tue, 13 Aug 2024 10:08:40 +0200 Subject: [PATCH] rename files and widgets from my... to mih... --- .../lib/components/buildFilesList.dart | 12 +- .../lib/components/buildNotesList.dart | 14 +- .../lib/components/buildPatientList.dart | 108 ++++++++++++- .../lib/components/homeTileGrid.dart | 8 +- .../lib/components/medCertInput.dart | 8 +- .../lib/components/medicineSearch.dart | 4 +- .../{mybutton.dart => mihButton.dart} | 4 +- .../{myDateInput.dart => mihDateInput.dart} | 8 +- .../lib/components/mihDeleteMessage.dart | 6 +- ...opdownInput.dart => mihDropdownInput.dart} | 8 +- ...ErrorMessage.dart => mihErrorMessage.dart} | 8 +- .../{myFileInput.dart => mihFileInput.dart} | 8 +- ...myMLTextInput.dart => mihMLTextInput.dart} | 8 +- .../{myPassInput.dart => mihPassInput.dart} | 8 +- ...mySearchInput.dart => mihSearchInput.dart} | 8 +- ...essMessage.dart => mihSuccessMessage.dart} | 12 +- .../{myTextInput.dart => mihTextInput.dart} | 8 +- .../lib/components/mihTimeInput.dart | 146 ++++++++++++++++++ .../lib/components/patientDetails.dart | 26 ++-- .../lib/components/patientFiles.dart | 24 +-- .../lib/components/patientNotes.dart | 22 +-- .../lib/components/prescipInput.dart | 28 ++-- .../patient_manager/lib/pages/patientAdd.dart | 42 ++--- .../lib/pages/patientEdit.dart | 44 +++--- .../lib/pages/patientManager.dart | 12 +- .../lib/pages/profileBusinessAdd.dart | 36 ++--- .../lib/pages/profileBusinessUpdate.dart | 36 ++--- .../lib/pages/profileUserUpdate.dart | 24 +-- .../patient_manager/lib/pages/register.dart | 32 ++-- .../patient_manager/lib/pages/signin.dart | 18 +-- 30 files changed, 487 insertions(+), 243 deletions(-) rename Frontend/patient_manager/lib/components/{mybutton.dart => mihButton.dart} (93%) rename Frontend/patient_manager/lib/components/{myDateInput.dart => mihDateInput.dart} (95%) rename Frontend/patient_manager/lib/components/{myDropdownInput.dart => mihDropdownInput.dart} (96%) rename Frontend/patient_manager/lib/components/{myErrorMessage.dart => mihErrorMessage.dart} (99%) rename Frontend/patient_manager/lib/components/{myFileInput.dart => mihFileInput.dart} (96%) rename Frontend/patient_manager/lib/components/{myMLTextInput.dart => mihMLTextInput.dart} (94%) rename Frontend/patient_manager/lib/components/{myPassInput.dart => mihPassInput.dart} (96%) rename Frontend/patient_manager/lib/components/{mySearchInput.dart => mihSearchInput.dart} (95%) rename Frontend/patient_manager/lib/components/{mySuccessMessage.dart => mihSuccessMessage.dart} (90%) rename Frontend/patient_manager/lib/components/{myTextInput.dart => mihTextInput.dart} (96%) create mode 100644 Frontend/patient_manager/lib/components/mihTimeInput.dart diff --git a/Frontend/patient_manager/lib/components/buildFilesList.dart b/Frontend/patient_manager/lib/components/buildFilesList.dart index a650bbd0..c5b234bc 100644 --- a/Frontend/patient_manager/lib/components/buildFilesList.dart +++ b/Frontend/patient_manager/lib/components/buildFilesList.dart @@ -3,9 +3,9 @@ import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:patient_manager/components/BuildFileView.dart'; import 'package:patient_manager/components/mihDeleteMessage.dart'; -import 'package:patient_manager/components/myErrorMessage.dart'; -import 'package:patient_manager/components/mySuccessMessage.dart'; -import 'package:patient_manager/components/mybutton.dart'; +import 'package:patient_manager/components/mihErrorMessage.dart'; +import 'package:patient_manager/components/mihSuccessMessage.dart'; +import 'package:patient_manager/components/mihButton.dart'; import 'package:patient_manager/env/env.dart'; import 'package:patient_manager/main.dart'; import 'package:patient_manager/objects/appUser.dart'; @@ -122,7 +122,7 @@ class _BuildFilesListState extends State { showDialog( context: context, builder: (context) { - return const MyErrorMessage(errorType: "Internet Connection"); + return const MIHErrorMessage(errorType: "Internet Connection"); }, ); } @@ -131,7 +131,7 @@ class _BuildFilesListState extends State { showDialog( context: context, builder: (context) { - return MySuccessMessage( + return MIHSuccessMessage( successType: "Success", successMessage: message, ); @@ -198,7 +198,7 @@ class _BuildFilesListState extends State { SizedBox( width: 300, height: 100, - child: MyButton( + child: MIHButton( onTap: () { html.window.open( url, diff --git a/Frontend/patient_manager/lib/components/buildNotesList.dart b/Frontend/patient_manager/lib/components/buildNotesList.dart index 4f6cc9db..047e370f 100644 --- a/Frontend/patient_manager/lib/components/buildNotesList.dart +++ b/Frontend/patient_manager/lib/components/buildNotesList.dart @@ -2,9 +2,9 @@ import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:patient_manager/components/mihDeleteMessage.dart'; -import 'package:patient_manager/components/myErrorMessage.dart'; -import 'package:patient_manager/components/myMLTextInput.dart'; -import 'package:patient_manager/components/mySuccessMessage.dart'; +import 'package:patient_manager/components/mihErrorMessage.dart'; +import 'package:patient_manager/components/mihMLTextInput.dart'; +import 'package:patient_manager/components/mihSuccessMessage.dart'; import 'package:patient_manager/env/env.dart'; import 'package:patient_manager/main.dart'; import 'package:patient_manager/objects/appUser.dart'; @@ -58,7 +58,7 @@ class _BuildNotesListState extends State { showDialog( context: context, builder: (context) { - return const MyErrorMessage(errorType: "Internet Connection"); + return const MIHErrorMessage(errorType: "Internet Connection"); }, ); } @@ -67,7 +67,7 @@ class _BuildNotesListState extends State { showDialog( context: context, builder: (context) { - return MySuccessMessage( + return MIHSuccessMessage( successType: "Success", successMessage: message, ); @@ -129,7 +129,7 @@ class _BuildNotesListState extends State { ), const SizedBox(height: 25.0), Expanded( - child: MyMLTextField( + child: MIHMLTextField( controller: noteTextController, hintText: "Note Details", editable: false, @@ -140,7 +140,7 @@ class _BuildNotesListState extends State { // SizedBox( // width: 300, // height: 100, - // child: MyButton( + // child: MIHButton( // onTap: () { // Navigator.pop(context); // }, diff --git a/Frontend/patient_manager/lib/components/buildPatientList.dart b/Frontend/patient_manager/lib/components/buildPatientList.dart index 798e149e..3815944a 100644 --- a/Frontend/patient_manager/lib/components/buildPatientList.dart +++ b/Frontend/patient_manager/lib/components/buildPatientList.dart @@ -1,9 +1,9 @@ import 'package:flutter/material.dart'; +import 'package:patient_manager/components/mihErrorMessage.dart'; +import 'package:patient_manager/components/mihButton.dart'; import 'package:patient_manager/main.dart'; import 'package:patient_manager/objects/appUser.dart'; -import 'package:patient_manager/objects/arguments.dart'; import 'package:patient_manager/objects/patients.dart'; -//import 'package:patient_manager/pages/patientView.dart'; class BuildPatientsList extends StatefulWidget { final List patients; @@ -20,6 +20,104 @@ class BuildPatientsList extends StatefulWidget { } class _BuildPatientsListState extends State { + TextEditingController dateController = TextEditingController(); + TextEditingController timeController = TextEditingController(); + + void submitApointment() {} + + bool isAppointmentFieldsFilled() { + if (dateController.text.isEmpty || timeController.text.isEmpty) { + return false; + } else { + return true; + } + } + + void appointmentPopUp() { + showDialog( + context: context, + barrierDismissible: false, + builder: (context) => Dialog( + child: Stack( + children: [ + Container( + padding: const EdgeInsets.all(10.0), + width: 700.0, + //height: 475.0, + decoration: BoxDecoration( + color: MzanziInnovationHub.of(context)!.theme.primaryColor(), + borderRadius: BorderRadius.circular(25.0), + border: Border.all( + color: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), + width: 5.0), + ), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Text( + "Add Patient to appointment", + textAlign: TextAlign.center, + style: TextStyle( + color: MzanziInnovationHub.of(context)! + .theme + .secondaryColor(), + fontSize: 35.0, + fontWeight: FontWeight.bold, + ), + ), + const SizedBox(height: 25.0), + SizedBox( + width: 300, + height: 100, + child: MIHButton( + buttonText: "Generate", + buttonColor: MzanziInnovationHub.of(context)! + .theme + .secondaryColor(), + textColor: + MzanziInnovationHub.of(context)!.theme.primaryColor(), + onTap: () { + if (isAppointmentFieldsFilled()) { + submitApointment(); + Navigator.pop(context); + } else { + showDialog( + context: context, + builder: (context) { + return const MIHErrorMessage( + errorType: "Input Error"); + }, + ); + } + }, + ), + ) + ], + ), + ), + Positioned( + top: 5, + right: 5, + width: 50, + height: 50, + child: IconButton( + onPressed: () { + Navigator.pop(context); + }, + icon: Icon( + Icons.close, + color: MzanziInnovationHub.of(context)!.theme.errorColor(), + size: 35, + ), + ), + ), + ], + ), + ), + ); + } + Widget isMainMember(int index) { //var matchRE = RegExp(r'^[a-z]+$'); var firstLetterFName = widget.patients[index].first_name[0]; @@ -91,9 +189,9 @@ class _BuildPatientsListState extends State { ), onTap: () { setState(() { - Navigator.of(context).pushNamed('/patient-manager/patient', - arguments: PatientViewArguments( - widget.signedInUser, widget.patients[index], "business")); + // Navigator.of(context).pushNamed('/patient-manager/patient', + // arguments: PatientViewArguments( + // widget.signedInUser, widget.patients[index], "business")); }); }, trailing: Icon( diff --git a/Frontend/patient_manager/lib/components/homeTileGrid.dart b/Frontend/patient_manager/lib/components/homeTileGrid.dart index 91545cbd..bc9a9831 100644 --- a/Frontend/patient_manager/lib/components/homeTileGrid.dart +++ b/Frontend/patient_manager/lib/components/homeTileGrid.dart @@ -6,8 +6,8 @@ import 'package:patient_manager/components/mihAppDrawer.dart'; import 'package:patient_manager/components/mihDeleteMessage.dart'; import 'package:patient_manager/components/mihLoadingCircle.dart'; import 'package:patient_manager/components/mihWarningMessage.dart'; -import 'package:patient_manager/components/myErrorMessage.dart'; -import 'package:patient_manager/components/mySuccessMessage.dart'; +import 'package:patient_manager/components/mihErrorMessage.dart'; +import 'package:patient_manager/components/mihSuccessMessage.dart'; import 'package:patient_manager/env/env.dart'; import 'package:patient_manager/main.dart'; import 'package:patient_manager/objects/appUser.dart'; @@ -227,7 +227,7 @@ class _HomeTileGridState extends State { showDialog( context: context, builder: (context) { - return const MyErrorMessage(errorType: "Invalid Username"); + return const MIHErrorMessage(errorType: "Invalid Username"); }, ); } @@ -239,7 +239,7 @@ class _HomeTileGridState extends State { showDialog( context: context, builder: (context) { - return const MySuccessMessage( + return const MIHSuccessMessage( successType: "Success", successMessage: "Congratulations! Your account has been created successfully. You are log in and can start exploring.\n\nPlease note: more apps will appear once you update your profile."); diff --git a/Frontend/patient_manager/lib/components/medCertInput.dart b/Frontend/patient_manager/lib/components/medCertInput.dart index a09991d9..b73fc048 100644 --- a/Frontend/patient_manager/lib/components/medCertInput.dart +++ b/Frontend/patient_manager/lib/components/medCertInput.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:patient_manager/components/myDateInput.dart'; +import 'package:patient_manager/components/mihDateInput.dart'; class Medcertinput extends StatefulWidget { final startDateController; @@ -26,7 +26,7 @@ class _MedcertinputState extends State { const SizedBox(height: 50.0), SizedBox( width: 700, - child: MyDateField( + child: MIHDateField( controller: widget.startDateController, LableText: "From", required: true, @@ -35,7 +35,7 @@ class _MedcertinputState extends State { const SizedBox(height: 25.0), SizedBox( width: 700, - child: MyDateField( + child: MIHDateField( controller: widget.endDateTextController, LableText: "Up to Including", required: true, @@ -44,7 +44,7 @@ class _MedcertinputState extends State { const SizedBox(height: 25.0), SizedBox( width: 700, - child: MyDateField( + child: MIHDateField( controller: widget.retDateTextController, LableText: "Return", required: true, diff --git a/Frontend/patient_manager/lib/components/medicineSearch.dart b/Frontend/patient_manager/lib/components/medicineSearch.dart index a771af81..82482b08 100644 --- a/Frontend/patient_manager/lib/components/medicineSearch.dart +++ b/Frontend/patient_manager/lib/components/medicineSearch.dart @@ -3,7 +3,7 @@ import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:patient_manager/components/buildMedList.dart'; import 'package:patient_manager/components/mihLoadingCircle.dart'; -import 'package:patient_manager/components/myErrorMessage.dart'; +import 'package:patient_manager/components/mihErrorMessage.dart'; import 'package:patient_manager/env/env.dart'; import 'package:patient_manager/main.dart'; import 'package:patient_manager/objects/medicine.dart'; @@ -47,7 +47,7 @@ class _MedicineSearchState extends State { showDialog( context: context, builder: (context) { - return const MyErrorMessage(errorType: "Internet Connection"); + return const MIHErrorMessage(errorType: "Internet Connection"); }, ); } diff --git a/Frontend/patient_manager/lib/components/mybutton.dart b/Frontend/patient_manager/lib/components/mihButton.dart similarity index 93% rename from Frontend/patient_manager/lib/components/mybutton.dart rename to Frontend/patient_manager/lib/components/mihButton.dart index 9401c7f1..1a1a6b5a 100644 --- a/Frontend/patient_manager/lib/components/mybutton.dart +++ b/Frontend/patient_manager/lib/components/mihButton.dart @@ -1,12 +1,12 @@ import 'package:flutter/material.dart'; -class MyButton extends StatelessWidget { +class MIHButton extends StatelessWidget { final void Function() onTap; final String buttonText; final Color buttonColor; final Color textColor; - const MyButton({ + const MIHButton({ super.key, required this.onTap, required this.buttonText, diff --git a/Frontend/patient_manager/lib/components/myDateInput.dart b/Frontend/patient_manager/lib/components/mihDateInput.dart similarity index 95% rename from Frontend/patient_manager/lib/components/myDateInput.dart rename to Frontend/patient_manager/lib/components/mihDateInput.dart index eeca2602..77786d29 100644 --- a/Frontend/patient_manager/lib/components/myDateInput.dart +++ b/Frontend/patient_manager/lib/components/mihDateInput.dart @@ -1,12 +1,12 @@ import 'package:flutter/material.dart'; import 'package:patient_manager/main.dart'; -class MyDateField extends StatefulWidget { +class MIHDateField extends StatefulWidget { final controller; final String LableText; final bool required; - const MyDateField({ + const MIHDateField({ super.key, required this.controller, required this.LableText, @@ -14,10 +14,10 @@ class MyDateField extends StatefulWidget { }); @override - State createState() => _MyDateFieldState(); + State createState() => _MIHDateFieldState(); } -class _MyDateFieldState extends State { +class _MIHDateFieldState extends State { FocusNode _focus = FocusNode(); bool startup = true; // bool makeEditable() { diff --git a/Frontend/patient_manager/lib/components/mihDeleteMessage.dart b/Frontend/patient_manager/lib/components/mihDeleteMessage.dart index 018157d1..fbf2d56c 100644 --- a/Frontend/patient_manager/lib/components/mihDeleteMessage.dart +++ b/Frontend/patient_manager/lib/components/mihDeleteMessage.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:patient_manager/components/mybutton.dart'; +import 'package:patient_manager/components/mihButton.dart'; import 'package:patient_manager/main.dart'; class MIHDeleteMessage extends StatefulWidget { @@ -72,7 +72,7 @@ class _MIHDeleteMessageState extends State { SizedBox( width: 300, height: 100, - child: MyButton( + child: MIHButton( onTap: widget.onTap, buttonText: "Delete", buttonColor: MzanziInnovationHub.of(context)! @@ -157,7 +157,7 @@ class _MIHDeleteMessageState extends State { SizedBox( width: 300, height: 100, - child: MyButton( + child: MIHButton( onTap: widget.onTap, buttonText: "Delete", buttonColor: MzanziInnovationHub.of(context)! diff --git a/Frontend/patient_manager/lib/components/myDropdownInput.dart b/Frontend/patient_manager/lib/components/mihDropdownInput.dart similarity index 96% rename from Frontend/patient_manager/lib/components/myDropdownInput.dart rename to Frontend/patient_manager/lib/components/mihDropdownInput.dart index 151c6e67..0d8dce43 100644 --- a/Frontend/patient_manager/lib/components/myDropdownInput.dart +++ b/Frontend/patient_manager/lib/components/mihDropdownInput.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:patient_manager/main.dart'; -class MyDropdownField extends StatefulWidget { +class MIHDropdownField extends StatefulWidget { final TextEditingController controller; final String hintText; final bool required; @@ -9,7 +9,7 @@ class MyDropdownField extends StatefulWidget { final void Function(String?)? onSelect; final bool editable; - const MyDropdownField({ + const MIHDropdownField({ super.key, required this.controller, required this.hintText, @@ -20,10 +20,10 @@ class MyDropdownField extends StatefulWidget { }); @override - State createState() => _MyDropdownFieldState(); + State createState() => _MIHDropdownFieldState(); } -class _MyDropdownFieldState extends State { +class _MIHDropdownFieldState extends State { //var dropbownItems = ["Dr.", "Assistant"]; bool startup = true; final FocusNode _focus = FocusNode(); diff --git a/Frontend/patient_manager/lib/components/myErrorMessage.dart b/Frontend/patient_manager/lib/components/mihErrorMessage.dart similarity index 99% rename from Frontend/patient_manager/lib/components/myErrorMessage.dart rename to Frontend/patient_manager/lib/components/mihErrorMessage.dart index 16ecdc28..6d789f00 100644 --- a/Frontend/patient_manager/lib/components/myErrorMessage.dart +++ b/Frontend/patient_manager/lib/components/mihErrorMessage.dart @@ -1,18 +1,18 @@ import 'package:flutter/material.dart'; import 'package:patient_manager/main.dart'; -class MyErrorMessage extends StatefulWidget { +class MIHErrorMessage extends StatefulWidget { final String errorType; - const MyErrorMessage({ + const MIHErrorMessage({ super.key, required this.errorType, }); @override - State createState() => _MyErrorMessageState(); + State createState() => _MIHErrorMessageState(); } -class _MyErrorMessageState extends State { +class _MIHErrorMessageState extends State { var messageTypes = {}; // late double width = 50; // late double height = 50; diff --git a/Frontend/patient_manager/lib/components/myFileInput.dart b/Frontend/patient_manager/lib/components/mihFileInput.dart similarity index 96% rename from Frontend/patient_manager/lib/components/myFileInput.dart rename to Frontend/patient_manager/lib/components/mihFileInput.dart index 2d4f9436..0a5bc10a 100644 --- a/Frontend/patient_manager/lib/components/myFileInput.dart +++ b/Frontend/patient_manager/lib/components/mihFileInput.dart @@ -1,14 +1,14 @@ import 'package:flutter/material.dart'; import 'package:patient_manager/main.dart'; -class MyFileField extends StatefulWidget { +class MIHFileField extends StatefulWidget { final TextEditingController controller; final String hintText; final bool editable; final bool required; final void Function() onPressed; - const MyFileField({ + const MIHFileField({ super.key, required this.controller, required this.hintText, @@ -18,10 +18,10 @@ class MyFileField extends StatefulWidget { }); @override - State createState() => _MyFileFieldState(); + State createState() => _MIHFileFieldState(); } -class _MyFileFieldState extends State { +class _MIHFileFieldState extends State { bool startup = true; FocusNode _focus = FocusNode(); diff --git a/Frontend/patient_manager/lib/components/myMLTextInput.dart b/Frontend/patient_manager/lib/components/mihMLTextInput.dart similarity index 94% rename from Frontend/patient_manager/lib/components/myMLTextInput.dart rename to Frontend/patient_manager/lib/components/mihMLTextInput.dart index f2dc22ab..f9638380 100644 --- a/Frontend/patient_manager/lib/components/myMLTextInput.dart +++ b/Frontend/patient_manager/lib/components/mihMLTextInput.dart @@ -1,13 +1,13 @@ import 'package:flutter/material.dart'; import 'package:patient_manager/main.dart'; -class MyMLTextField extends StatefulWidget { +class MIHMLTextField extends StatefulWidget { final controller; final String hintText; final bool editable; final bool required; - const MyMLTextField({ + const MIHMLTextField({ super.key, required this.controller, required this.hintText, @@ -16,10 +16,10 @@ class MyMLTextField extends StatefulWidget { }); @override - State createState() => _MyMLTextFieldState(); + State createState() => _MIHMLTextFieldState(); } -class _MyMLTextFieldState extends State { +class _MIHMLTextFieldState extends State { bool startup = true; FocusNode _focus = FocusNode(); diff --git a/Frontend/patient_manager/lib/components/myPassInput.dart b/Frontend/patient_manager/lib/components/mihPassInput.dart similarity index 96% rename from Frontend/patient_manager/lib/components/myPassInput.dart rename to Frontend/patient_manager/lib/components/mihPassInput.dart index b208d489..41a09eaa 100644 --- a/Frontend/patient_manager/lib/components/myPassInput.dart +++ b/Frontend/patient_manager/lib/components/mihPassInput.dart @@ -1,13 +1,13 @@ import 'package:flutter/material.dart'; import 'package:patient_manager/main.dart'; -class MyPassField extends StatefulWidget { +class MIHPassField extends StatefulWidget { final TextEditingController controller; final String hintText; final bool required; final bool signIn; - const MyPassField({ + const MIHPassField({ super.key, required this.controller, required this.hintText, @@ -16,10 +16,10 @@ class MyPassField extends StatefulWidget { }); @override - State createState() => _MyPassFieldState(); + State createState() => _MIHPassFieldState(); } -class _MyPassFieldState extends State { +class _MIHPassFieldState extends State { bool startup = true; final textFieldFocusNode = FocusNode(); bool _obscured = true; diff --git a/Frontend/patient_manager/lib/components/mySearchInput.dart b/Frontend/patient_manager/lib/components/mihSearchInput.dart similarity index 95% rename from Frontend/patient_manager/lib/components/mySearchInput.dart rename to Frontend/patient_manager/lib/components/mihSearchInput.dart index f6163dc6..79f63bcb 100644 --- a/Frontend/patient_manager/lib/components/mySearchInput.dart +++ b/Frontend/patient_manager/lib/components/mihSearchInput.dart @@ -1,14 +1,14 @@ import 'package:flutter/material.dart'; import 'package:patient_manager/main.dart'; -class MySearchField extends StatefulWidget { +class MIHSearchField extends StatefulWidget { final TextEditingController controller; final String hintText; final bool required; final bool editable; final void Function() onTap; - const MySearchField({ + const MIHSearchField({ super.key, required this.controller, required this.hintText, @@ -18,10 +18,10 @@ class MySearchField extends StatefulWidget { }); @override - State createState() => _MySearchFieldState(); + State createState() => _MIHSearchFieldState(); } -class _MySearchFieldState extends State { +class _MIHSearchFieldState extends State { bool startup = true; FocusNode _focus = FocusNode(); diff --git a/Frontend/patient_manager/lib/components/mySuccessMessage.dart b/Frontend/patient_manager/lib/components/mihSuccessMessage.dart similarity index 90% rename from Frontend/patient_manager/lib/components/mySuccessMessage.dart rename to Frontend/patient_manager/lib/components/mihSuccessMessage.dart index 629e4602..e709dbb3 100644 --- a/Frontend/patient_manager/lib/components/mySuccessMessage.dart +++ b/Frontend/patient_manager/lib/components/mihSuccessMessage.dart @@ -1,21 +1,21 @@ import 'package:flutter/material.dart'; -import 'package:patient_manager/components/mybutton.dart'; +import 'package:patient_manager/components/mihButton.dart'; import 'package:patient_manager/main.dart'; -class MySuccessMessage extends StatefulWidget { +class MIHSuccessMessage extends StatefulWidget { final String successType; final String successMessage; - const MySuccessMessage({ + const MIHSuccessMessage({ super.key, required this.successType, required this.successMessage, }); @override - State createState() => _MySuccessMessageState(); + State createState() => _MIHSuccessMessageState(); } -class _MySuccessMessageState extends State { +class _MIHSuccessMessageState extends State { var messageTypes = {}; late String message; @@ -71,7 +71,7 @@ class _MySuccessMessageState extends State { SizedBox( width: 300, height: 100, - child: MyButton( + child: MIHButton( onTap: () { Navigator.pop(context); }, diff --git a/Frontend/patient_manager/lib/components/myTextInput.dart b/Frontend/patient_manager/lib/components/mihTextInput.dart similarity index 96% rename from Frontend/patient_manager/lib/components/myTextInput.dart rename to Frontend/patient_manager/lib/components/mihTextInput.dart index 374e968f..712265ab 100644 --- a/Frontend/patient_manager/lib/components/myTextInput.dart +++ b/Frontend/patient_manager/lib/components/mihTextInput.dart @@ -1,13 +1,13 @@ import 'package:flutter/material.dart'; import 'package:patient_manager/main.dart'; -class MyTextField extends StatefulWidget { +class MIHTextField extends StatefulWidget { final TextEditingController controller; final String hintText; final bool editable; final bool required; - const MyTextField({ + const MIHTextField({ super.key, required this.controller, required this.hintText, @@ -16,10 +16,10 @@ class MyTextField extends StatefulWidget { }); @override - State createState() => _MyTextFieldState(); + State createState() => _MIHTextFieldState(); } -class _MyTextFieldState extends State { +class _MIHTextFieldState extends State { bool startup = true; FocusNode _focus = FocusNode(); diff --git a/Frontend/patient_manager/lib/components/mihTimeInput.dart b/Frontend/patient_manager/lib/components/mihTimeInput.dart new file mode 100644 index 00000000..77786d29 --- /dev/null +++ b/Frontend/patient_manager/lib/components/mihTimeInput.dart @@ -0,0 +1,146 @@ +import 'package:flutter/material.dart'; +import 'package:patient_manager/main.dart'; + +class MIHDateField extends StatefulWidget { + final controller; + final String LableText; + final bool required; + + const MIHDateField({ + super.key, + required this.controller, + required this.LableText, + required this.required, + }); + + @override + State createState() => _MIHDateFieldState(); +} + +class _MIHDateFieldState extends State { + FocusNode _focus = FocusNode(); + bool startup = true; + // bool makeEditable() { + Future _selectDate(BuildContext context) async { + DateTime? picked = await showDatePicker( + context: context, + initialDate: DateTime.now(), + firstDate: DateTime(2000), + lastDate: DateTime(2100), + ); + if (picked != null) { + setState(() { + widget.controller.text = picked.toString().split(" ")[0]; + }); + } + } + + Widget setRequiredText() { + if (widget.required) { + return Row( + mainAxisSize: MainAxisSize.min, + children: [ + Text( + "*", + style: TextStyle( + color: MzanziInnovationHub.of(context)!.theme.errorColor()), + ), + const SizedBox( + width: 8.0, + ), + Text(widget.LableText, + style: TextStyle( + color: + MzanziInnovationHub.of(context)!.theme.secondaryColor())), + ], + ); + } else { + return Text(widget.LableText, + style: TextStyle( + color: MzanziInnovationHub.of(context)!.theme.secondaryColor())); + } + } + + void _onFocusChange() { + setState(() { + startup = false; + }); + } + + String? get _errorText { + final text = widget.controller.text; + if (startup) { + return null; + } + if (!widget.required) { + return null; + } + if (text.isEmpty) { + return "${widget.LableText} is required"; + } + return null; + } + + @override + void initState() { + _focus.addListener(_onFocusChange); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return TextField( + style: TextStyle( + color: MzanziInnovationHub.of(context)!.theme.secondaryColor()), + controller: widget.controller, + readOnly: true, + obscureText: false, + focusNode: _focus, + onChanged: (_) => setState(() { + startup = false; + }), + decoration: InputDecoration( + errorText: _errorText, + errorStyle: TextStyle( + color: MzanziInnovationHub.of(context)!.theme.errorColor(), + fontWeight: FontWeight.bold), + label: setRequiredText(), + //labelText: widget.LableText, + //labelStyle: const TextStyle(color: Colors.blueAccent), + prefixIcon: Icon( + Icons.calendar_today, + color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), + ), + fillColor: MzanziInnovationHub.of(context)!.theme.primaryColor(), + filled: true, + //hintText: hintText, + //hintStyle: TextStyle(color: Colors.blueGrey[400]), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), + width: 2.0, + ), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: MzanziInnovationHub.of(context)!.theme.errorColor(), + width: 2.0, + ), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: MzanziInnovationHub.of(context)!.theme.errorColor(), + width: 2.0, + ), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: MzanziInnovationHub.of(context)!.theme.secondaryColor()), + ), + ), + onTap: () { + _selectDate(context); + }, + ); + } +} diff --git a/Frontend/patient_manager/lib/components/patientDetails.dart b/Frontend/patient_manager/lib/components/patientDetails.dart index 25173491..82b5906d 100644 --- a/Frontend/patient_manager/lib/components/patientDetails.dart +++ b/Frontend/patient_manager/lib/components/patientDetails.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:patient_manager/components/myTextInput.dart'; +import 'package:patient_manager/components/mihTextInput.dart'; import 'package:patient_manager/main.dart'; import 'package:patient_manager/objects/patients.dart'; @@ -41,7 +41,7 @@ class _PatientDetailsState extends State { children: [ SizedBox( width: textFieldWidth, - child: MyTextField( + child: MIHTextField( controller: idController, hintText: "ID No.", editable: false, @@ -49,7 +49,7 @@ class _PatientDetailsState extends State { ), SizedBox( width: textFieldWidth, - child: MyTextField( + child: MIHTextField( controller: fnameController, hintText: "Name", editable: false, @@ -57,7 +57,7 @@ class _PatientDetailsState extends State { ), SizedBox( width: textFieldWidth, - child: MyTextField( + child: MIHTextField( controller: lnameController, hintText: "Surname", editable: false, @@ -65,7 +65,7 @@ class _PatientDetailsState extends State { ), SizedBox( width: textFieldWidth, - child: MyTextField( + child: MIHTextField( controller: cellController, hintText: "Cell No.", editable: false, @@ -73,7 +73,7 @@ class _PatientDetailsState extends State { ), SizedBox( width: textFieldWidth, - child: MyTextField( + child: MIHTextField( controller: emailController, hintText: "Email", editable: false, @@ -81,7 +81,7 @@ class _PatientDetailsState extends State { ), SizedBox( width: textFieldWidth, - child: MyTextField( + child: MIHTextField( controller: addressController, hintText: "Address", editable: false, @@ -95,7 +95,7 @@ class _PatientDetailsState extends State { List medAidDet = []; medAidDet.add(SizedBox( width: textFieldWidth, - child: MyTextField( + child: MIHTextField( controller: medAidController, hintText: "Medical Aid", editable: false, @@ -112,7 +112,7 @@ class _PatientDetailsState extends State { visible: req, child: SizedBox( width: textFieldWidth, - child: MyTextField( + child: MIHTextField( controller: medMainMemController, hintText: "Main Member", editable: false, @@ -124,7 +124,7 @@ class _PatientDetailsState extends State { visible: req, child: SizedBox( width: textFieldWidth, - child: MyTextField( + child: MIHTextField( controller: medNoController, hintText: "No.", editable: false, @@ -136,7 +136,7 @@ class _PatientDetailsState extends State { visible: req, child: SizedBox( width: textFieldWidth, - child: MyTextField( + child: MIHTextField( controller: medAidCodeController, hintText: "Code", editable: false, @@ -148,7 +148,7 @@ class _PatientDetailsState extends State { visible: req, child: SizedBox( width: textFieldWidth, - child: MyTextField( + child: MIHTextField( controller: medNameController, hintText: "Name", editable: false, @@ -160,7 +160,7 @@ class _PatientDetailsState extends State { visible: req, child: SizedBox( width: textFieldWidth, - child: MyTextField( + child: MIHTextField( controller: medSchemeController, hintText: "Scheme", editable: false, diff --git a/Frontend/patient_manager/lib/components/patientFiles.dart b/Frontend/patient_manager/lib/components/patientFiles.dart index 1dbc5189..82b67e96 100644 --- a/Frontend/patient_manager/lib/components/patientFiles.dart +++ b/Frontend/patient_manager/lib/components/patientFiles.dart @@ -6,10 +6,10 @@ import 'package:flutter/material.dart'; import 'package:patient_manager/components/buildFilesList.dart'; import 'package:patient_manager/components/medCertInput.dart'; import 'package:patient_manager/components/mihLoadingCircle.dart'; -import 'package:patient_manager/components/myErrorMessage.dart'; -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/components/mihErrorMessage.dart'; +import 'package:patient_manager/components/mihSuccessMessage.dart'; +import 'package:patient_manager/components/mihTextInput.dart'; +import 'package:patient_manager/components/mihButton.dart'; import 'package:patient_manager/components/prescipInput.dart'; import 'package:patient_manager/env/env.dart'; import 'package:patient_manager/main.dart'; @@ -229,7 +229,7 @@ class _PatientFilesState extends State { showDialog( context: context, builder: (context) { - return MySuccessMessage( + return MIHSuccessMessage( successType: "Success", successMessage: message, ); @@ -290,7 +290,7 @@ class _PatientFilesState extends State { SizedBox( width: 300, height: 100, - child: MyButton( + child: MIHButton( buttonText: "Generate", buttonColor: MzanziInnovationHub.of(context)! .theme @@ -305,7 +305,7 @@ class _PatientFilesState extends State { showDialog( context: context, builder: (context) { - return const MyErrorMessage( + return const MIHErrorMessage( errorType: "Input Error"); }, ); @@ -450,7 +450,7 @@ class _PatientFilesState extends State { const SizedBox(height: 25.0), SizedBox( width: 700, - child: MyButton( + child: MIHButton( buttonText: "Select File", buttonColor: MzanziInnovationHub.of(context)! .theme @@ -475,7 +475,7 @@ class _PatientFilesState extends State { }, ), ), - MyTextField( + MIHTextField( controller: selectedFileController, hintText: "Selected FIle", editable: false, @@ -484,7 +484,7 @@ class _PatientFilesState extends State { SizedBox( width: 300, height: 100, - child: MyButton( + child: MIHButton( buttonText: "Add File", buttonColor: MzanziInnovationHub.of(context)! .theme @@ -499,7 +499,7 @@ class _PatientFilesState extends State { showDialog( context: context, builder: (context) { - return const MyErrorMessage( + return const MIHErrorMessage( errorType: "Input Error"); }, ); @@ -536,7 +536,7 @@ class _PatientFilesState extends State { showDialog( context: context, builder: (context) { - return const MyErrorMessage(errorType: "Internet Connection"); + return const MIHErrorMessage(errorType: "Internet Connection"); }, ); } diff --git a/Frontend/patient_manager/lib/components/patientNotes.dart b/Frontend/patient_manager/lib/components/patientNotes.dart index ae6a3fca..d09691f8 100644 --- a/Frontend/patient_manager/lib/components/patientNotes.dart +++ b/Frontend/patient_manager/lib/components/patientNotes.dart @@ -3,11 +3,11 @@ import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:patient_manager/components/buildNotesList.dart'; import 'package:patient_manager/components/mihLoadingCircle.dart'; -import 'package:patient_manager/components/myErrorMessage.dart'; -import 'package:patient_manager/components/myMLTextInput.dart'; -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/components/mihErrorMessage.dart'; +import 'package:patient_manager/components/mihMLTextInput.dart'; +import 'package:patient_manager/components/mihSuccessMessage.dart'; +import 'package:patient_manager/components/mihTextInput.dart'; +import 'package:patient_manager/components/mihButton.dart'; import 'package:patient_manager/env/env.dart'; import 'package:patient_manager/main.dart'; import 'package:patient_manager/objects/appUser.dart'; @@ -81,7 +81,7 @@ class _PatientNotesState extends State { showDialog( context: context, builder: (context) { - return MySuccessMessage( + return MIHSuccessMessage( successType: "Success", successMessage: message, ); @@ -93,7 +93,7 @@ class _PatientNotesState extends State { showDialog( context: context, builder: (context) { - return const MyErrorMessage(errorType: "Internet Connection"); + return const MIHErrorMessage(errorType: "Internet Connection"); }, ); } @@ -145,7 +145,7 @@ class _PatientNotesState extends State { const SizedBox(height: 25.0), SizedBox( width: 700, - child: MyTextField( + child: MIHTextField( controller: titleController, hintText: "Title of Note", editable: true, @@ -154,7 +154,7 @@ class _PatientNotesState extends State { ), const SizedBox(height: 25.0), Expanded( - child: MyMLTextField( + child: MIHMLTextField( controller: noteTextController, hintText: "Note Details", editable: true, @@ -164,7 +164,7 @@ class _PatientNotesState extends State { SizedBox( width: 300, height: 100, - child: MyButton( + child: MIHButton( onTap: () { if (isFieldsFilled()) { addPatientNoteAPICall(); @@ -173,7 +173,7 @@ class _PatientNotesState extends State { showDialog( context: context, builder: (context) { - return const MyErrorMessage( + return const MIHErrorMessage( errorType: "Input Error"); }, ); diff --git a/Frontend/patient_manager/lib/components/prescipInput.dart b/Frontend/patient_manager/lib/components/prescipInput.dart index 19a007db..022698ea 100644 --- a/Frontend/patient_manager/lib/components/prescipInput.dart +++ b/Frontend/patient_manager/lib/components/prescipInput.dart @@ -1,9 +1,9 @@ import 'package:flutter/material.dart'; import 'package:patient_manager/components/medicineSearch.dart'; -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/components/mihDropdownInput.dart'; +import 'package:patient_manager/components/mihErrorMessage.dart'; +import 'package:patient_manager/components/mihSearchInput.dart'; +import 'package:patient_manager/components/mihButton.dart'; import 'package:patient_manager/main.dart'; class PrescripInput extends StatefulWidget { @@ -126,7 +126,7 @@ class _PrescripInputState extends State { children: [ SizedBox( width: 300, - child: MySearchField( + child: MIHSearchField( controller: widget.medicineController, hintText: "Medicine", required: true, @@ -139,7 +139,7 @@ class _PrescripInputState extends State { const SizedBox(height: 25.0), SizedBox( width: 300, - child: MyDropdownField( + child: MIHDropdownField( controller: widget.quantityController, hintText: "Quantity", dropdownOptions: numberOptions, @@ -150,7 +150,7 @@ class _PrescripInputState extends State { const SizedBox(height: 25.0), SizedBox( width: 300, - child: MyDropdownField( + child: MIHDropdownField( controller: widget.dosageController, hintText: "Dosage", dropdownOptions: numberOptions, @@ -161,7 +161,7 @@ class _PrescripInputState extends State { const SizedBox(height: 25.0), SizedBox( width: 300, - child: MyDropdownField( + child: MIHDropdownField( controller: widget.timesDailyController, hintText: "Times Daily", dropdownOptions: numberOptions, @@ -172,7 +172,7 @@ class _PrescripInputState extends State { const SizedBox(height: 25.0), SizedBox( width: 300, - child: MyDropdownField( + child: MIHDropdownField( controller: widget.noDaysController, hintText: "No. Days", dropdownOptions: numberOptions, @@ -183,7 +183,7 @@ class _PrescripInputState extends State { const SizedBox(height: 25.0), SizedBox( width: 300, - child: MyDropdownField( + child: MIHDropdownField( controller: widget.noRepeatsController, hintText: "No. Repeats", dropdownOptions: numberOptions, @@ -193,7 +193,7 @@ class _PrescripInputState extends State { ), SizedBox( width: 300, - child: MyButton( + child: MIHButton( buttonText: "Add", buttonColor: MzanziInnovationHub.of(context)!.theme.secondaryColor(), @@ -215,7 +215,7 @@ class _PrescripInputState extends State { showDialog( context: context, builder: (context) { - return const MyErrorMessage(errorType: "Input Error"); + return const MIHErrorMessage(errorType: "Input Error"); }, ); } @@ -281,7 +281,7 @@ class _PrescripInputState extends State { SizedBox( width: 300, height: 100, - child: MyButton( + child: MIHButton( onTap: () { // if (isMedCertFieldsFilled()) { // generateMedCert(); @@ -290,7 +290,7 @@ class _PrescripInputState extends State { // showDialog( // context: context, // builder: (context) { - // return const MyErrorMessage( + // return const MIHErrorMessage( // errorType: "Input Error"); // }, // ); diff --git a/Frontend/patient_manager/lib/pages/patientAdd.dart b/Frontend/patient_manager/lib/pages/patientAdd.dart index ad114407..ced525f1 100644 --- a/Frontend/patient_manager/lib/pages/patientAdd.dart +++ b/Frontend/patient_manager/lib/pages/patientAdd.dart @@ -2,11 +2,11 @@ import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -import 'package:patient_manager/components/myDropdownInput.dart'; -import 'package:patient_manager/components/myErrorMessage.dart'; -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/components/mihDropdownInput.dart'; +import 'package:patient_manager/components/mihErrorMessage.dart'; +import 'package:patient_manager/components/mihSuccessMessage.dart'; +import 'package:patient_manager/components/mihTextInput.dart'; +import 'package:patient_manager/components/mihButton.dart'; import 'package:patient_manager/env/env.dart'; import 'package:patient_manager/main.dart'; import 'package:patient_manager/objects/appUser.dart'; @@ -114,7 +114,7 @@ class _AddPatientState extends State { showDialog( context: context, builder: (context) { - return const MyErrorMessage(errorType: "Internet Connection"); + return const MIHErrorMessage(errorType: "Internet Connection"); }, ); } @@ -134,7 +134,7 @@ class _AddPatientState extends State { showDialog( context: context, builder: (context) { - return MySuccessMessage( + return MIHSuccessMessage( successType: "Success", successMessage: message, ); @@ -170,7 +170,7 @@ class _AddPatientState extends State { ), ), const SizedBox(height: 10.0), - MyTextField( + MIHTextField( controller: idController, hintText: "13 digit ID Number or Passport", editable: true, @@ -178,7 +178,7 @@ class _AddPatientState extends State { ), const SizedBox(height: 10.0), - MyTextField( + MIHTextField( controller: fnameController, hintText: "First Name", editable: false, @@ -186,7 +186,7 @@ class _AddPatientState extends State { ), const SizedBox(height: 10.0), - MyTextField( + MIHTextField( controller: lnameController, hintText: "Last Name", editable: false, @@ -195,7 +195,7 @@ class _AddPatientState extends State { const SizedBox(height: 10.0), - MyTextField( + MIHTextField( controller: cellController, hintText: "Cell Number", editable: true, @@ -204,7 +204,7 @@ class _AddPatientState extends State { const SizedBox(height: 10.0), - MyTextField( + MIHTextField( controller: emailController, hintText: "Email", editable: false, @@ -213,7 +213,7 @@ class _AddPatientState extends State { const SizedBox(height: 10.0), - MyTextField( + MIHTextField( controller: addressController, hintText: "Address", editable: true, @@ -232,7 +232,7 @@ class _AddPatientState extends State { ), const SizedBox(height: 10.0), - MyDropdownField( + MIHDropdownField( controller: medAidController, hintText: "Medical Aid", editable: true, @@ -247,7 +247,7 @@ class _AddPatientState extends State { child: Column( children: [ const SizedBox(height: 10.0), - MyDropdownField( + MIHDropdownField( controller: medMainMemController, hintText: "Main Member", editable: medRequired, @@ -255,28 +255,28 @@ class _AddPatientState extends State { dropdownOptions: const ["Yes", "No"], ), const SizedBox(height: 10.0), - MyTextField( + MIHTextField( controller: medNoController, hintText: "Medical Aid No.", editable: medRequired, required: medRequired, ), const SizedBox(height: 10.0), - MyTextField( + MIHTextField( controller: medAidCodeController, hintText: "Medical Aid Code", editable: medRequired, required: medRequired, ), const SizedBox(height: 10.0), - MyTextField( + MIHTextField( controller: medNameController, hintText: "Medical Aid Name", editable: medRequired, required: medRequired, ), const SizedBox(height: 10.0), - MyTextField( + MIHTextField( controller: medSchemeController, hintText: "Medical Aid Scheme", editable: medRequired, @@ -291,7 +291,7 @@ class _AddPatientState extends State { SizedBox( width: 450.0, height: 100.0, - child: MyButton( + child: MIHButton( onTap: () { submitForm(); }, @@ -313,7 +313,7 @@ class _AddPatientState extends State { showDialog( context: context, builder: (context) { - return const MyErrorMessage(errorType: "Input Error"); + return const MIHErrorMessage(errorType: "Input Error"); }, ); } diff --git a/Frontend/patient_manager/lib/pages/patientEdit.dart b/Frontend/patient_manager/lib/pages/patientEdit.dart index d8a9b6ad..264c48b7 100644 --- a/Frontend/patient_manager/lib/pages/patientEdit.dart +++ b/Frontend/patient_manager/lib/pages/patientEdit.dart @@ -3,11 +3,11 @@ import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:patient_manager/components/mihAppBar.dart'; -import 'package:patient_manager/components/myDropdownInput.dart'; -import 'package:patient_manager/components/myErrorMessage.dart'; -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/components/mihDropdownInput.dart'; +import 'package:patient_manager/components/mihErrorMessage.dart'; +import 'package:patient_manager/components/mihSuccessMessage.dart'; +import 'package:patient_manager/components/mihTextInput.dart'; +import 'package:patient_manager/components/mihButton.dart'; import 'package:patient_manager/env/env.dart'; import 'package:patient_manager/main.dart'; import 'package:patient_manager/objects/patients.dart'; @@ -163,7 +163,7 @@ class _EditPatientState extends State { showDialog( context: context, builder: (context) { - return const MyErrorMessage(errorType: "Internet Connection"); + return const MIHErrorMessage(errorType: "Internet Connection"); }, ); } @@ -259,7 +259,7 @@ class _EditPatientState extends State { SizedBox( width: 300, height: 100, - child: MyButton( + child: MIHButton( onTap: deletePatientApiCall, buttonText: "Delete", buttonColor: MzanziInnovationHub.of(context)! @@ -299,7 +299,7 @@ class _EditPatientState extends State { showDialog( context: context, builder: (context) { - return MySuccessMessage( + return MIHSuccessMessage( successType: "Success", successMessage: message, ); @@ -382,7 +382,7 @@ class _EditPatientState extends State { ], ), const SizedBox(height: 10.0), - MyTextField( + MIHTextField( controller: idController, hintText: "13 digit ID Number or Passport", editable: false, @@ -390,7 +390,7 @@ class _EditPatientState extends State { ), const SizedBox(height: 10.0), - MyTextField( + MIHTextField( controller: fnameController, hintText: "First Name", editable: false, @@ -398,7 +398,7 @@ class _EditPatientState extends State { ), const SizedBox(height: 10.0), - MyTextField( + MIHTextField( controller: lnameController, hintText: "Last Name", editable: false, @@ -406,7 +406,7 @@ class _EditPatientState extends State { ), const SizedBox(height: 10.0), - MyTextField( + MIHTextField( controller: cellController, hintText: "Cell Number", editable: true, @@ -414,7 +414,7 @@ class _EditPatientState extends State { ), const SizedBox(height: 10.0), - MyTextField( + MIHTextField( controller: emailController, hintText: "Email", editable: false, @@ -422,7 +422,7 @@ class _EditPatientState extends State { ), const SizedBox(height: 10.0), - MyTextField( + MIHTextField( controller: addressController, hintText: "Address", editable: true, @@ -440,7 +440,7 @@ class _EditPatientState extends State { ), ), const SizedBox(height: 10.0), - MyDropdownField( + MIHDropdownField( controller: medAidController, hintText: "Medical Aid", onSelect: (selected) { @@ -463,7 +463,7 @@ class _EditPatientState extends State { child: Column( children: [ const SizedBox(height: 10.0), - MyDropdownField( + MIHDropdownField( controller: medMainMemController, hintText: "Main Member.", editable: medRequired, @@ -471,28 +471,28 @@ class _EditPatientState extends State { dropdownOptions: const ["Yes", "No"], ), const SizedBox(height: 10.0), - MyTextField( + MIHTextField( controller: medNoController, hintText: "Medical Aid No.", editable: medRequired, required: medRequired, ), const SizedBox(height: 10.0), - MyTextField( + MIHTextField( controller: medAidCodeController, hintText: "Medical Aid Code", editable: medRequired, required: medRequired, ), const SizedBox(height: 10.0), - MyTextField( + MIHTextField( controller: medNameController, hintText: "Medical Aid Name", editable: medRequired, required: medRequired, ), const SizedBox(height: 10.0), - MyTextField( + MIHTextField( controller: medSchemeController, hintText: "Medical Aid Scheme", editable: medRequired, @@ -506,7 +506,7 @@ class _EditPatientState extends State { SizedBox( width: 500.0, height: 100.0, - child: MyButton( + child: MIHButton( onTap: () { submitForm(); }, @@ -537,7 +537,7 @@ class _EditPatientState extends State { showDialog( context: context, builder: (context) { - return const MyErrorMessage(errorType: "Input Error"); + return const MIHErrorMessage(errorType: "Input Error"); }, ); } diff --git a/Frontend/patient_manager/lib/pages/patientManager.dart b/Frontend/patient_manager/lib/pages/patientManager.dart index 4c77d344..25c95632 100644 --- a/Frontend/patient_manager/lib/pages/patientManager.dart +++ b/Frontend/patient_manager/lib/pages/patientManager.dart @@ -8,12 +8,12 @@ import 'package:patient_manager/components/buildPatientList.dart'; import 'package:patient_manager/components/buildPatientQueueList.dart'; import 'package:patient_manager/components/mihAppBar.dart'; import 'package:patient_manager/components/mihLoadingCircle.dart'; -import 'package:patient_manager/components/myDateInput.dart'; -import 'package:patient_manager/components/myErrorMessage.dart'; +import 'package:patient_manager/components/mihDateInput.dart'; +import 'package:patient_manager/components/mihErrorMessage.dart'; import 'package:patient_manager/objects/arguments.dart'; import 'package:patient_manager/objects/patientQueue.dart'; import 'package:supertokens_flutter/http.dart' as http; -import 'package:patient_manager/components/mySearchInput.dart'; +import 'package:patient_manager/components/mihSearchInput.dart'; import 'package:patient_manager/env/env.dart'; import 'package:patient_manager/main.dart'; import 'package:patient_manager/objects/patients.dart'; @@ -177,7 +177,7 @@ class _PatientManagerState extends State { ), //spacer const SizedBox(height: 10), - MySearchField( + MIHSearchField( controller: searchController, hintText: "ID or Medical Aid No. Search", required: true, @@ -304,7 +304,7 @@ class _PatientManagerState extends State { style: TextStyle(fontSize: 25, fontWeight: FontWeight.bold), ), const SizedBox(height: 10), - MyDateField( + MIHDateField( controller: queueDateController, LableText: "Date", required: true, @@ -383,7 +383,7 @@ class _PatientManagerState extends State { showDialog( context: context, builder: (context) { - return const MyErrorMessage(errorType: "Input Error"); + return const MIHErrorMessage(errorType: "Input Error"); }, ); } diff --git a/Frontend/patient_manager/lib/pages/profileBusinessAdd.dart b/Frontend/patient_manager/lib/pages/profileBusinessAdd.dart index 4bb38d79..952757a3 100644 --- a/Frontend/patient_manager/lib/pages/profileBusinessAdd.dart +++ b/Frontend/patient_manager/lib/pages/profileBusinessAdd.dart @@ -4,12 +4,12 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:patient_manager/components/mihAppBar.dart'; import 'package:patient_manager/components/mihLoadingCircle.dart'; -import 'package:patient_manager/components/myDropdownInput.dart'; -import 'package:patient_manager/components/myErrorMessage.dart'; -import 'package:patient_manager/components/myFileInput.dart'; -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/components/mihDropdownInput.dart'; +import 'package:patient_manager/components/mihErrorMessage.dart'; +import 'package:patient_manager/components/mihFileInput.dart'; +import 'package:patient_manager/components/mihSuccessMessage.dart'; +import 'package:patient_manager/components/mihTextInput.dart'; +import 'package:patient_manager/components/mihButton.dart'; import 'package:patient_manager/env/env.dart'; import 'package:patient_manager/main.dart'; import 'package:patient_manager/objects/appUser.dart'; @@ -128,7 +128,7 @@ class _ProfileBusinessAddState extends State { showDialog( context: context, builder: (context) { - return const MyErrorMessage(errorType: "Internet Connection"); + return const MIHErrorMessage(errorType: "Internet Connection"); }, ); } @@ -137,7 +137,7 @@ class _ProfileBusinessAddState extends State { showDialog( context: context, builder: (context) { - return MySuccessMessage( + return MIHSuccessMessage( successType: "Success", successMessage: message, ); @@ -184,21 +184,21 @@ class _ProfileBusinessAddState extends State { ), ), const SizedBox(height: 15.0), - MyTextField( + MIHTextField( controller: regController, hintText: "Registration No.", editable: true, required: true, ), const SizedBox(height: 10.0), - MyTextField( + MIHTextField( controller: nameController, hintText: "Business Name", editable: true, required: true, ), const SizedBox(height: 10.0), - MyDropdownField( + MIHDropdownField( controller: typeController, hintText: "Business Type", dropdownOptions: const ["Doctors Office", "Other"], @@ -206,7 +206,7 @@ class _ProfileBusinessAddState extends State { editable: true, ), const SizedBox(height: 10.0), - MyFileField( + MIHFileField( controller: logonameController, hintText: "Logo", editable: false, @@ -240,7 +240,7 @@ class _ProfileBusinessAddState extends State { ), ), const SizedBox(height: 15.0), - MyDropdownField( + MIHDropdownField( controller: titleController, hintText: "Title", dropdownOptions: const ["Doctor", "Assistant"], @@ -248,21 +248,21 @@ class _ProfileBusinessAddState extends State { editable: true, ), const SizedBox(height: 10.0), - MyTextField( + MIHTextField( controller: fnameController, hintText: "Name", editable: false, required: true, ), const SizedBox(height: 10.0), - MyTextField( + MIHTextField( controller: lnameController, hintText: "Surname", editable: false, required: true, ), const SizedBox(height: 10.0), - MyFileField( + MIHFileField( controller: signtureController, hintText: "Signature", editable: false, @@ -284,7 +284,7 @@ class _ProfileBusinessAddState extends State { }, ), const SizedBox(height: 15.0), - MyDropdownField( + MIHDropdownField( controller: accessController, hintText: "Access", dropdownOptions: const ["Full", "Partial"], @@ -295,7 +295,7 @@ class _ProfileBusinessAddState extends State { SizedBox( width: 500.0, height: 100.0, - child: MyButton( + child: MIHButton( buttonText: "Add", buttonColor: MzanziInnovationHub.of(context)!.theme.secondaryColor(), diff --git a/Frontend/patient_manager/lib/pages/profileBusinessUpdate.dart b/Frontend/patient_manager/lib/pages/profileBusinessUpdate.dart index 5a49f85e..c9cdc5d0 100644 --- a/Frontend/patient_manager/lib/pages/profileBusinessUpdate.dart +++ b/Frontend/patient_manager/lib/pages/profileBusinessUpdate.dart @@ -5,12 +5,12 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:patient_manager/components/mihAppBar.dart'; import 'package:patient_manager/components/mihLoadingCircle.dart'; -import 'package:patient_manager/components/myDropdownInput.dart'; -import 'package:patient_manager/components/myErrorMessage.dart'; -import 'package:patient_manager/components/myFileInput.dart'; -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/components/mihDropdownInput.dart'; +import 'package:patient_manager/components/mihErrorMessage.dart'; +import 'package:patient_manager/components/mihFileInput.dart'; +import 'package:patient_manager/components/mihSuccessMessage.dart'; +import 'package:patient_manager/components/mihTextInput.dart'; +import 'package:patient_manager/components/mihButton.dart'; import 'package:patient_manager/env/env.dart'; import 'package:patient_manager/main.dart'; import 'package:patient_manager/objects/arguments.dart'; @@ -196,7 +196,7 @@ class _ProfileBusinessUpdateState extends State { showDialog( context: context, builder: (context) { - return const MyErrorMessage(errorType: "Internet Connection"); + return const MIHErrorMessage(errorType: "Internet Connection"); }, ); } @@ -205,7 +205,7 @@ class _ProfileBusinessUpdateState extends State { showDialog( context: context, builder: (context) { - return MySuccessMessage( + return MIHSuccessMessage( successType: "Success", successMessage: message, ); @@ -270,21 +270,21 @@ class _ProfileBusinessUpdateState extends State { ), ), const SizedBox(height: 15.0), - MyTextField( + MIHTextField( controller: regController, hintText: "Registration No.", editable: true, required: true, ), const SizedBox(height: 10.0), - MyTextField( + MIHTextField( controller: nameController, hintText: "Business Name", editable: true, required: true, ), const SizedBox(height: 10.0), - MyDropdownField( + MIHDropdownField( controller: typeController, hintText: "Business Type", dropdownOptions: const ["Doctors Office", "Other"], @@ -292,7 +292,7 @@ class _ProfileBusinessUpdateState extends State { editable: true, ), const SizedBox(height: 10.0), - MyFileField( + MIHFileField( controller: logonameController, hintText: "Logo", editable: false, @@ -331,7 +331,7 @@ class _ProfileBusinessUpdateState extends State { ), ), const SizedBox(height: 15.0), - MyDropdownField( + MIHDropdownField( controller: titleController, hintText: "Title", dropdownOptions: const ["Doctor", "Assistant"], @@ -339,21 +339,21 @@ class _ProfileBusinessUpdateState extends State { editable: true, ), const SizedBox(height: 10.0), - MyTextField( + MIHTextField( controller: fnameController, hintText: "Name", editable: false, required: true, ), const SizedBox(height: 10.0), - MyTextField( + MIHTextField( controller: lnameController, hintText: "Surname", editable: false, required: true, ), const SizedBox(height: 10.0), - MyFileField( + MIHFileField( controller: signtureController, hintText: "Signature", editable: false, @@ -375,7 +375,7 @@ class _ProfileBusinessUpdateState extends State { }, ), const SizedBox(height: 15.0), - MyDropdownField( + MIHDropdownField( controller: accessController, hintText: "Access", dropdownOptions: const ["Full", "Partial"], @@ -386,7 +386,7 @@ class _ProfileBusinessUpdateState extends State { SizedBox( width: 500.0, height: 100.0, - child: MyButton( + child: MIHButton( buttonText: "Add", buttonColor: MzanziInnovationHub.of(context)! .theme diff --git a/Frontend/patient_manager/lib/pages/profileUserUpdate.dart b/Frontend/patient_manager/lib/pages/profileUserUpdate.dart index 52709e28..f2947811 100644 --- a/Frontend/patient_manager/lib/pages/profileUserUpdate.dart +++ b/Frontend/patient_manager/lib/pages/profileUserUpdate.dart @@ -3,10 +3,10 @@ import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:patient_manager/components/mihAppBar.dart'; -import 'package:patient_manager/components/myErrorMessage.dart'; -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/components/mihErrorMessage.dart'; +import 'package:patient_manager/components/mihSuccessMessage.dart'; +import 'package:patient_manager/components/mihTextInput.dart'; +import 'package:patient_manager/components/mihButton.dart'; import 'package:patient_manager/env/env.dart'; import 'package:patient_manager/main.dart'; import 'package:patient_manager/objects/appUser.dart'; @@ -98,7 +98,7 @@ class _ProfileUserUpdateState extends State { showDialog( context: context, builder: (context) { - return const MyErrorMessage(errorType: "Internet Connection"); + return const MIHErrorMessage(errorType: "Internet Connection"); }, ); } @@ -107,7 +107,7 @@ class _ProfileUserUpdateState extends State { showDialog( context: context, builder: (context) { - return MySuccessMessage( + return MIHSuccessMessage( successType: "Success", successMessage: message, ); @@ -119,7 +119,7 @@ class _ProfileUserUpdateState extends State { showDialog( context: context, builder: (context) { - return const MyErrorMessage(errorType: "Invalid Username"); + return const MIHErrorMessage(errorType: "Invalid Username"); }, ); } @@ -136,7 +136,7 @@ class _ProfileUserUpdateState extends State { showDialog( context: context, builder: (context) { - return const MyErrorMessage(errorType: "Input Error"); + return const MIHErrorMessage(errorType: "Input Error"); }, ); } @@ -180,21 +180,21 @@ class _ProfileUserUpdateState extends State { ), ), const SizedBox(height: 15.0), - MyTextField( + MIHTextField( controller: usernameController, hintText: "Username", editable: true, required: true, ), const SizedBox(height: 10.0), - MyTextField( + MIHTextField( controller: fnameController, hintText: "First Name", editable: true, required: true, ), const SizedBox(height: 10.0), - MyTextField( + MIHTextField( controller: lnameController, hintText: "Last Name", editable: true, @@ -229,7 +229,7 @@ class _ProfileUserUpdateState extends State { SizedBox( width: 500.0, height: 100.0, - child: MyButton( + child: MIHButton( buttonText: "Update", buttonColor: MzanziInnovationHub.of(context)!.theme.secondaryColor(), diff --git a/Frontend/patient_manager/lib/pages/register.dart b/Frontend/patient_manager/lib/pages/register.dart index 3d4a7f07..de7f6a48 100644 --- a/Frontend/patient_manager/lib/pages/register.dart +++ b/Frontend/patient_manager/lib/pages/register.dart @@ -3,11 +3,11 @@ import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:patient_manager/components/mihLoadingCircle.dart'; -import 'package:patient_manager/components/myErrorMessage.dart'; -import 'package:patient_manager/components/myPassInput.dart'; -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/components/mihErrorMessage.dart'; +import 'package:patient_manager/components/mihPassInput.dart'; +import 'package:patient_manager/components/mihSuccessMessage.dart'; +import 'package:patient_manager/components/mihTextInput.dart'; +import 'package:patient_manager/components/mihButton.dart'; import 'package:patient_manager/env/env.dart'; import 'package:patient_manager/main.dart'; //import 'package:patient_manager/objects/sessionST.dart'; @@ -139,7 +139,7 @@ class _RegisterState extends State { showDialog( context: context, builder: (context) { - return const MyErrorMessage(errorType: "Internet Connection"); + return const MIHErrorMessage(errorType: "Internet Connection"); }, ); } @@ -148,7 +148,7 @@ class _RegisterState extends State { showDialog( context: context, builder: (context) { - return const MySuccessMessage( + return const MIHSuccessMessage( successType: "Success", successMessage: "Congratulations! Your account has been created successfully. You are logged in and can start exploring.\n\nPlease note: more apps will appear once you update your profile."); @@ -160,7 +160,7 @@ class _RegisterState extends State { showDialog( context: context, builder: (context) { - return const MyErrorMessage(errorType: "User Exists"); + return const MIHErrorMessage(errorType: "User Exists"); }, ); } @@ -169,7 +169,7 @@ class _RegisterState extends State { showDialog( context: context, builder: (context) { - return const MyErrorMessage(errorType: "Password Match"); + return const MIHErrorMessage(errorType: "Password Match"); }, ); } @@ -178,7 +178,7 @@ class _RegisterState extends State { showDialog( context: context, builder: (context) { - return const MyErrorMessage(errorType: "Invalid Email"); + return const MIHErrorMessage(errorType: "Invalid Email"); }, ); } @@ -187,7 +187,7 @@ class _RegisterState extends State { showDialog( context: context, builder: (context) { - return const MyErrorMessage(errorType: "Password Requirements"); + return const MIHErrorMessage(errorType: "Password Requirements"); }, ); } @@ -210,7 +210,7 @@ class _RegisterState extends State { showDialog( context: context, builder: (context) { - return const MyErrorMessage(errorType: "Input Error"); + return const MIHErrorMessage(errorType: "Input Error"); }, ); } else { @@ -272,7 +272,7 @@ class _RegisterState extends State { //email input SizedBox( width: 500.0, - child: MyTextField( + child: MIHTextField( controller: emailController, hintText: 'Email', editable: true, @@ -284,7 +284,7 @@ class _RegisterState extends State { //password input SizedBox( width: 500.0, - child: MyPassField( + child: MIHPassField( controller: passwordController, hintText: 'Password', required: true, @@ -296,7 +296,7 @@ class _RegisterState extends State { //password input SizedBox( width: 500.0, - child: MyPassField( + child: MIHPassField( controller: confirmPasswordController, hintText: 'Confirm Password', required: true, @@ -309,7 +309,7 @@ class _RegisterState extends State { SizedBox( width: 500.0, height: 100.0, - child: MyButton( + child: MIHButton( buttonText: "Sign Up", buttonColor: MzanziInnovationHub.of(context)! .theme diff --git a/Frontend/patient_manager/lib/pages/signin.dart b/Frontend/patient_manager/lib/pages/signin.dart index 7b5ff8ac..bdc7ef06 100644 --- a/Frontend/patient_manager/lib/pages/signin.dart +++ b/Frontend/patient_manager/lib/pages/signin.dart @@ -3,10 +3,10 @@ import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:patient_manager/components/mihLoadingCircle.dart'; -import 'package:patient_manager/components/myErrorMessage.dart'; -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/components/mihErrorMessage.dart'; +import 'package:patient_manager/components/mihPassInput.dart'; +import 'package:patient_manager/components/mihTextInput.dart'; +import 'package:patient_manager/components/mihButton.dart'; import 'package:patient_manager/env/env.dart'; import 'package:patient_manager/main.dart'; import 'package:supabase_auth_ui/supabase_auth_ui.dart'; @@ -79,7 +79,7 @@ class _SignInState extends State { showDialog( context: context, builder: (context) { - return const MyErrorMessage(errorType: "Invalid Credentials"); + return const MIHErrorMessage(errorType: "Invalid Credentials"); }, ); } @@ -89,7 +89,7 @@ class _SignInState extends State { showDialog( context: context, builder: (context) { - return const MyErrorMessage(errorType: "Input Error"); + return const MIHErrorMessage(errorType: "Input Error"); }, ); } else { @@ -148,7 +148,7 @@ class _SignInState extends State { //email input SizedBox( width: 500.0, - child: MyTextField( + child: MIHTextField( controller: emailController, hintText: 'Email', editable: true, @@ -160,7 +160,7 @@ class _SignInState extends State { //password input SizedBox( width: 500.0, - child: MyPassField( + child: MIHPassField( controller: passwordController, hintText: 'Password', required: true, @@ -173,7 +173,7 @@ class _SignInState extends State { SizedBox( width: 500.0, height: 100.0, - child: MyButton( + child: MIHButton( buttonText: "Sign In", buttonColor: MzanziInnovationHub.of(context)! .theme