rename files and widgets from my... to mih...

This commit is contained in:
2024-08-13 10:08:40 +02:00
parent b9a8adb59f
commit 7a6ba04220
30 changed files with 487 additions and 243 deletions

View File

@@ -3,9 +3,9 @@ import 'dart:convert';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:patient_manager/components/BuildFileView.dart'; import 'package:patient_manager/components/BuildFileView.dart';
import 'package:patient_manager/components/mihDeleteMessage.dart'; import 'package:patient_manager/components/mihDeleteMessage.dart';
import 'package:patient_manager/components/myErrorMessage.dart'; import 'package:patient_manager/components/mihErrorMessage.dart';
import 'package:patient_manager/components/mySuccessMessage.dart'; import 'package:patient_manager/components/mihSuccessMessage.dart';
import 'package:patient_manager/components/mybutton.dart'; import 'package:patient_manager/components/mihButton.dart';
import 'package:patient_manager/env/env.dart'; import 'package:patient_manager/env/env.dart';
import 'package:patient_manager/main.dart'; import 'package:patient_manager/main.dart';
import 'package:patient_manager/objects/appUser.dart'; import 'package:patient_manager/objects/appUser.dart';
@@ -122,7 +122,7 @@ class _BuildFilesListState extends State<BuildFilesList> {
showDialog( showDialog(
context: context, context: context,
builder: (context) { builder: (context) {
return const MyErrorMessage(errorType: "Internet Connection"); return const MIHErrorMessage(errorType: "Internet Connection");
}, },
); );
} }
@@ -131,7 +131,7 @@ class _BuildFilesListState extends State<BuildFilesList> {
showDialog( showDialog(
context: context, context: context,
builder: (context) { builder: (context) {
return MySuccessMessage( return MIHSuccessMessage(
successType: "Success", successType: "Success",
successMessage: message, successMessage: message,
); );
@@ -198,7 +198,7 @@ class _BuildFilesListState extends State<BuildFilesList> {
SizedBox( SizedBox(
width: 300, width: 300,
height: 100, height: 100,
child: MyButton( child: MIHButton(
onTap: () { onTap: () {
html.window.open( html.window.open(
url, url,

View File

@@ -2,9 +2,9 @@ import 'dart:convert';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:patient_manager/components/mihDeleteMessage.dart'; import 'package:patient_manager/components/mihDeleteMessage.dart';
import 'package:patient_manager/components/myErrorMessage.dart'; import 'package:patient_manager/components/mihErrorMessage.dart';
import 'package:patient_manager/components/myMLTextInput.dart'; import 'package:patient_manager/components/mihMLTextInput.dart';
import 'package:patient_manager/components/mySuccessMessage.dart'; import 'package:patient_manager/components/mihSuccessMessage.dart';
import 'package:patient_manager/env/env.dart'; import 'package:patient_manager/env/env.dart';
import 'package:patient_manager/main.dart'; import 'package:patient_manager/main.dart';
import 'package:patient_manager/objects/appUser.dart'; import 'package:patient_manager/objects/appUser.dart';
@@ -58,7 +58,7 @@ class _BuildNotesListState extends State<BuildNotesList> {
showDialog( showDialog(
context: context, context: context,
builder: (context) { builder: (context) {
return const MyErrorMessage(errorType: "Internet Connection"); return const MIHErrorMessage(errorType: "Internet Connection");
}, },
); );
} }
@@ -67,7 +67,7 @@ class _BuildNotesListState extends State<BuildNotesList> {
showDialog( showDialog(
context: context, context: context,
builder: (context) { builder: (context) {
return MySuccessMessage( return MIHSuccessMessage(
successType: "Success", successType: "Success",
successMessage: message, successMessage: message,
); );
@@ -129,7 +129,7 @@ class _BuildNotesListState extends State<BuildNotesList> {
), ),
const SizedBox(height: 25.0), const SizedBox(height: 25.0),
Expanded( Expanded(
child: MyMLTextField( child: MIHMLTextField(
controller: noteTextController, controller: noteTextController,
hintText: "Note Details", hintText: "Note Details",
editable: false, editable: false,
@@ -140,7 +140,7 @@ class _BuildNotesListState extends State<BuildNotesList> {
// SizedBox( // SizedBox(
// width: 300, // width: 300,
// height: 100, // height: 100,
// child: MyButton( // child: MIHButton(
// onTap: () { // onTap: () {
// Navigator.pop(context); // Navigator.pop(context);
// }, // },

View File

@@ -1,9 +1,9 @@
import 'package:flutter/material.dart'; 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/main.dart';
import 'package:patient_manager/objects/appUser.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/objects/patients.dart';
//import 'package:patient_manager/pages/patientView.dart';
class BuildPatientsList extends StatefulWidget { class BuildPatientsList extends StatefulWidget {
final List<Patient> patients; final List<Patient> patients;
@@ -20,6 +20,104 @@ class BuildPatientsList extends StatefulWidget {
} }
class _BuildPatientsListState extends State<BuildPatientsList> { class _BuildPatientsListState extends State<BuildPatientsList> {
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) { Widget isMainMember(int index) {
//var matchRE = RegExp(r'^[a-z]+$'); //var matchRE = RegExp(r'^[a-z]+$');
var firstLetterFName = widget.patients[index].first_name[0]; var firstLetterFName = widget.patients[index].first_name[0];
@@ -91,9 +189,9 @@ class _BuildPatientsListState extends State<BuildPatientsList> {
), ),
onTap: () { onTap: () {
setState(() { setState(() {
Navigator.of(context).pushNamed('/patient-manager/patient', // Navigator.of(context).pushNamed('/patient-manager/patient',
arguments: PatientViewArguments( // arguments: PatientViewArguments(
widget.signedInUser, widget.patients[index], "business")); // widget.signedInUser, widget.patients[index], "business"));
}); });
}, },
trailing: Icon( trailing: Icon(

View File

@@ -6,8 +6,8 @@ import 'package:patient_manager/components/mihAppDrawer.dart';
import 'package:patient_manager/components/mihDeleteMessage.dart'; import 'package:patient_manager/components/mihDeleteMessage.dart';
import 'package:patient_manager/components/mihLoadingCircle.dart'; import 'package:patient_manager/components/mihLoadingCircle.dart';
import 'package:patient_manager/components/mihWarningMessage.dart'; import 'package:patient_manager/components/mihWarningMessage.dart';
import 'package:patient_manager/components/myErrorMessage.dart'; import 'package:patient_manager/components/mihErrorMessage.dart';
import 'package:patient_manager/components/mySuccessMessage.dart'; import 'package:patient_manager/components/mihSuccessMessage.dart';
import 'package:patient_manager/env/env.dart'; import 'package:patient_manager/env/env.dart';
import 'package:patient_manager/main.dart'; import 'package:patient_manager/main.dart';
import 'package:patient_manager/objects/appUser.dart'; import 'package:patient_manager/objects/appUser.dart';
@@ -227,7 +227,7 @@ class _HomeTileGridState extends State<HomeTileGrid> {
showDialog( showDialog(
context: context, context: context,
builder: (context) { builder: (context) {
return const MyErrorMessage(errorType: "Invalid Username"); return const MIHErrorMessage(errorType: "Invalid Username");
}, },
); );
} }
@@ -239,7 +239,7 @@ class _HomeTileGridState extends State<HomeTileGrid> {
showDialog( showDialog(
context: context, context: context,
builder: (context) { builder: (context) {
return const MySuccessMessage( return const MIHSuccessMessage(
successType: "Success", successType: "Success",
successMessage: 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."); "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.");

View File

@@ -1,5 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:patient_manager/components/myDateInput.dart'; import 'package:patient_manager/components/mihDateInput.dart';
class Medcertinput extends StatefulWidget { class Medcertinput extends StatefulWidget {
final startDateController; final startDateController;
@@ -26,7 +26,7 @@ class _MedcertinputState extends State<Medcertinput> {
const SizedBox(height: 50.0), const SizedBox(height: 50.0),
SizedBox( SizedBox(
width: 700, width: 700,
child: MyDateField( child: MIHDateField(
controller: widget.startDateController, controller: widget.startDateController,
LableText: "From", LableText: "From",
required: true, required: true,
@@ -35,7 +35,7 @@ class _MedcertinputState extends State<Medcertinput> {
const SizedBox(height: 25.0), const SizedBox(height: 25.0),
SizedBox( SizedBox(
width: 700, width: 700,
child: MyDateField( child: MIHDateField(
controller: widget.endDateTextController, controller: widget.endDateTextController,
LableText: "Up to Including", LableText: "Up to Including",
required: true, required: true,
@@ -44,7 +44,7 @@ class _MedcertinputState extends State<Medcertinput> {
const SizedBox(height: 25.0), const SizedBox(height: 25.0),
SizedBox( SizedBox(
width: 700, width: 700,
child: MyDateField( child: MIHDateField(
controller: widget.retDateTextController, controller: widget.retDateTextController,
LableText: "Return", LableText: "Return",
required: true, required: true,

View File

@@ -3,7 +3,7 @@ import 'dart:convert';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:patient_manager/components/buildMedList.dart'; import 'package:patient_manager/components/buildMedList.dart';
import 'package:patient_manager/components/mihLoadingCircle.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/env/env.dart';
import 'package:patient_manager/main.dart'; import 'package:patient_manager/main.dart';
import 'package:patient_manager/objects/medicine.dart'; import 'package:patient_manager/objects/medicine.dart';
@@ -47,7 +47,7 @@ class _MedicineSearchState extends State<MedicineSearch> {
showDialog( showDialog(
context: context, context: context,
builder: (context) { builder: (context) {
return const MyErrorMessage(errorType: "Internet Connection"); return const MIHErrorMessage(errorType: "Internet Connection");
}, },
); );
} }

View File

@@ -1,12 +1,12 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class MyButton extends StatelessWidget { class MIHButton extends StatelessWidget {
final void Function() onTap; final void Function() onTap;
final String buttonText; final String buttonText;
final Color buttonColor; final Color buttonColor;
final Color textColor; final Color textColor;
const MyButton({ const MIHButton({
super.key, super.key,
required this.onTap, required this.onTap,
required this.buttonText, required this.buttonText,

View File

@@ -1,12 +1,12 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:patient_manager/main.dart'; import 'package:patient_manager/main.dart';
class MyDateField extends StatefulWidget { class MIHDateField extends StatefulWidget {
final controller; final controller;
final String LableText; final String LableText;
final bool required; final bool required;
const MyDateField({ const MIHDateField({
super.key, super.key,
required this.controller, required this.controller,
required this.LableText, required this.LableText,
@@ -14,10 +14,10 @@ class MyDateField extends StatefulWidget {
}); });
@override @override
State<MyDateField> createState() => _MyDateFieldState(); State<MIHDateField> createState() => _MIHDateFieldState();
} }
class _MyDateFieldState extends State<MyDateField> { class _MIHDateFieldState extends State<MIHDateField> {
FocusNode _focus = FocusNode(); FocusNode _focus = FocusNode();
bool startup = true; bool startup = true;
// bool makeEditable() { // bool makeEditable() {

View File

@@ -1,5 +1,5 @@
import 'package:flutter/material.dart'; 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'; import 'package:patient_manager/main.dart';
class MIHDeleteMessage extends StatefulWidget { class MIHDeleteMessage extends StatefulWidget {
@@ -72,7 +72,7 @@ class _MIHDeleteMessageState extends State<MIHDeleteMessage> {
SizedBox( SizedBox(
width: 300, width: 300,
height: 100, height: 100,
child: MyButton( child: MIHButton(
onTap: widget.onTap, onTap: widget.onTap,
buttonText: "Delete", buttonText: "Delete",
buttonColor: MzanziInnovationHub.of(context)! buttonColor: MzanziInnovationHub.of(context)!
@@ -157,7 +157,7 @@ class _MIHDeleteMessageState extends State<MIHDeleteMessage> {
SizedBox( SizedBox(
width: 300, width: 300,
height: 100, height: 100,
child: MyButton( child: MIHButton(
onTap: widget.onTap, onTap: widget.onTap,
buttonText: "Delete", buttonText: "Delete",
buttonColor: MzanziInnovationHub.of(context)! buttonColor: MzanziInnovationHub.of(context)!

View File

@@ -1,7 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:patient_manager/main.dart'; import 'package:patient_manager/main.dart';
class MyDropdownField extends StatefulWidget { class MIHDropdownField extends StatefulWidget {
final TextEditingController controller; final TextEditingController controller;
final String hintText; final String hintText;
final bool required; final bool required;
@@ -9,7 +9,7 @@ class MyDropdownField extends StatefulWidget {
final void Function(String?)? onSelect; final void Function(String?)? onSelect;
final bool editable; final bool editable;
const MyDropdownField({ const MIHDropdownField({
super.key, super.key,
required this.controller, required this.controller,
required this.hintText, required this.hintText,
@@ -20,10 +20,10 @@ class MyDropdownField extends StatefulWidget {
}); });
@override @override
State<MyDropdownField> createState() => _MyDropdownFieldState(); State<MIHDropdownField> createState() => _MIHDropdownFieldState();
} }
class _MyDropdownFieldState extends State<MyDropdownField> { class _MIHDropdownFieldState extends State<MIHDropdownField> {
//var dropbownItems = ["Dr.", "Assistant"]; //var dropbownItems = ["Dr.", "Assistant"];
bool startup = true; bool startup = true;
final FocusNode _focus = FocusNode(); final FocusNode _focus = FocusNode();

View File

@@ -1,18 +1,18 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:patient_manager/main.dart'; import 'package:patient_manager/main.dart';
class MyErrorMessage extends StatefulWidget { class MIHErrorMessage extends StatefulWidget {
final String errorType; final String errorType;
const MyErrorMessage({ const MIHErrorMessage({
super.key, super.key,
required this.errorType, required this.errorType,
}); });
@override @override
State<MyErrorMessage> createState() => _MyErrorMessageState(); State<MIHErrorMessage> createState() => _MIHErrorMessageState();
} }
class _MyErrorMessageState extends State<MyErrorMessage> { class _MIHErrorMessageState extends State<MIHErrorMessage> {
var messageTypes = <String, Widget>{}; var messageTypes = <String, Widget>{};
// late double width = 50; // late double width = 50;
// late double height = 50; // late double height = 50;

View File

@@ -1,14 +1,14 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:patient_manager/main.dart'; import 'package:patient_manager/main.dart';
class MyFileField extends StatefulWidget { class MIHFileField extends StatefulWidget {
final TextEditingController controller; final TextEditingController controller;
final String hintText; final String hintText;
final bool editable; final bool editable;
final bool required; final bool required;
final void Function() onPressed; final void Function() onPressed;
const MyFileField({ const MIHFileField({
super.key, super.key,
required this.controller, required this.controller,
required this.hintText, required this.hintText,
@@ -18,10 +18,10 @@ class MyFileField extends StatefulWidget {
}); });
@override @override
State<MyFileField> createState() => _MyFileFieldState(); State<MIHFileField> createState() => _MIHFileFieldState();
} }
class _MyFileFieldState extends State<MyFileField> { class _MIHFileFieldState extends State<MIHFileField> {
bool startup = true; bool startup = true;
FocusNode _focus = FocusNode(); FocusNode _focus = FocusNode();

View File

@@ -1,13 +1,13 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:patient_manager/main.dart'; import 'package:patient_manager/main.dart';
class MyMLTextField extends StatefulWidget { class MIHMLTextField extends StatefulWidget {
final controller; final controller;
final String hintText; final String hintText;
final bool editable; final bool editable;
final bool required; final bool required;
const MyMLTextField({ const MIHMLTextField({
super.key, super.key,
required this.controller, required this.controller,
required this.hintText, required this.hintText,
@@ -16,10 +16,10 @@ class MyMLTextField extends StatefulWidget {
}); });
@override @override
State<MyMLTextField> createState() => _MyMLTextFieldState(); State<MIHMLTextField> createState() => _MIHMLTextFieldState();
} }
class _MyMLTextFieldState extends State<MyMLTextField> { class _MIHMLTextFieldState extends State<MIHMLTextField> {
bool startup = true; bool startup = true;
FocusNode _focus = FocusNode(); FocusNode _focus = FocusNode();

View File

@@ -1,13 +1,13 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:patient_manager/main.dart'; import 'package:patient_manager/main.dart';
class MyPassField extends StatefulWidget { class MIHPassField extends StatefulWidget {
final TextEditingController controller; final TextEditingController controller;
final String hintText; final String hintText;
final bool required; final bool required;
final bool signIn; final bool signIn;
const MyPassField({ const MIHPassField({
super.key, super.key,
required this.controller, required this.controller,
required this.hintText, required this.hintText,
@@ -16,10 +16,10 @@ class MyPassField extends StatefulWidget {
}); });
@override @override
State<MyPassField> createState() => _MyPassFieldState(); State<MIHPassField> createState() => _MIHPassFieldState();
} }
class _MyPassFieldState extends State<MyPassField> { class _MIHPassFieldState extends State<MIHPassField> {
bool startup = true; bool startup = true;
final textFieldFocusNode = FocusNode(); final textFieldFocusNode = FocusNode();
bool _obscured = true; bool _obscured = true;

View File

@@ -1,14 +1,14 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:patient_manager/main.dart'; import 'package:patient_manager/main.dart';
class MySearchField extends StatefulWidget { class MIHSearchField extends StatefulWidget {
final TextEditingController controller; final TextEditingController controller;
final String hintText; final String hintText;
final bool required; final bool required;
final bool editable; final bool editable;
final void Function() onTap; final void Function() onTap;
const MySearchField({ const MIHSearchField({
super.key, super.key,
required this.controller, required this.controller,
required this.hintText, required this.hintText,
@@ -18,10 +18,10 @@ class MySearchField extends StatefulWidget {
}); });
@override @override
State<MySearchField> createState() => _MySearchFieldState(); State<MIHSearchField> createState() => _MIHSearchFieldState();
} }
class _MySearchFieldState extends State<MySearchField> { class _MIHSearchFieldState extends State<MIHSearchField> {
bool startup = true; bool startup = true;
FocusNode _focus = FocusNode(); FocusNode _focus = FocusNode();

View File

@@ -1,21 +1,21 @@
import 'package:flutter/material.dart'; 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'; import 'package:patient_manager/main.dart';
class MySuccessMessage extends StatefulWidget { class MIHSuccessMessage extends StatefulWidget {
final String successType; final String successType;
final String successMessage; final String successMessage;
const MySuccessMessage({ const MIHSuccessMessage({
super.key, super.key,
required this.successType, required this.successType,
required this.successMessage, required this.successMessage,
}); });
@override @override
State<MySuccessMessage> createState() => _MySuccessMessageState(); State<MIHSuccessMessage> createState() => _MIHSuccessMessageState();
} }
class _MySuccessMessageState extends State<MySuccessMessage> { class _MIHSuccessMessageState extends State<MIHSuccessMessage> {
var messageTypes = <String, Widget>{}; var messageTypes = <String, Widget>{};
late String message; late String message;
@@ -71,7 +71,7 @@ class _MySuccessMessageState extends State<MySuccessMessage> {
SizedBox( SizedBox(
width: 300, width: 300,
height: 100, height: 100,
child: MyButton( child: MIHButton(
onTap: () { onTap: () {
Navigator.pop(context); Navigator.pop(context);
}, },

View File

@@ -1,13 +1,13 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:patient_manager/main.dart'; import 'package:patient_manager/main.dart';
class MyTextField extends StatefulWidget { class MIHTextField extends StatefulWidget {
final TextEditingController controller; final TextEditingController controller;
final String hintText; final String hintText;
final bool editable; final bool editable;
final bool required; final bool required;
const MyTextField({ const MIHTextField({
super.key, super.key,
required this.controller, required this.controller,
required this.hintText, required this.hintText,
@@ -16,10 +16,10 @@ class MyTextField extends StatefulWidget {
}); });
@override @override
State<MyTextField> createState() => _MyTextFieldState(); State<MIHTextField> createState() => _MIHTextFieldState();
} }
class _MyTextFieldState extends State<MyTextField> { class _MIHTextFieldState extends State<MIHTextField> {
bool startup = true; bool startup = true;
FocusNode _focus = FocusNode(); FocusNode _focus = FocusNode();

View File

@@ -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<MIHDateField> createState() => _MIHDateFieldState();
}
class _MIHDateFieldState extends State<MIHDateField> {
FocusNode _focus = FocusNode();
bool startup = true;
// bool makeEditable() {
Future<void> _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);
},
);
}
}

View File

@@ -1,5 +1,5 @@
import 'package:flutter/material.dart'; 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/main.dart';
import 'package:patient_manager/objects/patients.dart'; import 'package:patient_manager/objects/patients.dart';
@@ -41,7 +41,7 @@ class _PatientDetailsState extends State<PatientDetails> {
children: [ children: [
SizedBox( SizedBox(
width: textFieldWidth, width: textFieldWidth,
child: MyTextField( child: MIHTextField(
controller: idController, controller: idController,
hintText: "ID No.", hintText: "ID No.",
editable: false, editable: false,
@@ -49,7 +49,7 @@ class _PatientDetailsState extends State<PatientDetails> {
), ),
SizedBox( SizedBox(
width: textFieldWidth, width: textFieldWidth,
child: MyTextField( child: MIHTextField(
controller: fnameController, controller: fnameController,
hintText: "Name", hintText: "Name",
editable: false, editable: false,
@@ -57,7 +57,7 @@ class _PatientDetailsState extends State<PatientDetails> {
), ),
SizedBox( SizedBox(
width: textFieldWidth, width: textFieldWidth,
child: MyTextField( child: MIHTextField(
controller: lnameController, controller: lnameController,
hintText: "Surname", hintText: "Surname",
editable: false, editable: false,
@@ -65,7 +65,7 @@ class _PatientDetailsState extends State<PatientDetails> {
), ),
SizedBox( SizedBox(
width: textFieldWidth, width: textFieldWidth,
child: MyTextField( child: MIHTextField(
controller: cellController, controller: cellController,
hintText: "Cell No.", hintText: "Cell No.",
editable: false, editable: false,
@@ -73,7 +73,7 @@ class _PatientDetailsState extends State<PatientDetails> {
), ),
SizedBox( SizedBox(
width: textFieldWidth, width: textFieldWidth,
child: MyTextField( child: MIHTextField(
controller: emailController, controller: emailController,
hintText: "Email", hintText: "Email",
editable: false, editable: false,
@@ -81,7 +81,7 @@ class _PatientDetailsState extends State<PatientDetails> {
), ),
SizedBox( SizedBox(
width: textFieldWidth, width: textFieldWidth,
child: MyTextField( child: MIHTextField(
controller: addressController, controller: addressController,
hintText: "Address", hintText: "Address",
editable: false, editable: false,
@@ -95,7 +95,7 @@ class _PatientDetailsState extends State<PatientDetails> {
List<Widget> medAidDet = []; List<Widget> medAidDet = [];
medAidDet.add(SizedBox( medAidDet.add(SizedBox(
width: textFieldWidth, width: textFieldWidth,
child: MyTextField( child: MIHTextField(
controller: medAidController, controller: medAidController,
hintText: "Medical Aid", hintText: "Medical Aid",
editable: false, editable: false,
@@ -112,7 +112,7 @@ class _PatientDetailsState extends State<PatientDetails> {
visible: req, visible: req,
child: SizedBox( child: SizedBox(
width: textFieldWidth, width: textFieldWidth,
child: MyTextField( child: MIHTextField(
controller: medMainMemController, controller: medMainMemController,
hintText: "Main Member", hintText: "Main Member",
editable: false, editable: false,
@@ -124,7 +124,7 @@ class _PatientDetailsState extends State<PatientDetails> {
visible: req, visible: req,
child: SizedBox( child: SizedBox(
width: textFieldWidth, width: textFieldWidth,
child: MyTextField( child: MIHTextField(
controller: medNoController, controller: medNoController,
hintText: "No.", hintText: "No.",
editable: false, editable: false,
@@ -136,7 +136,7 @@ class _PatientDetailsState extends State<PatientDetails> {
visible: req, visible: req,
child: SizedBox( child: SizedBox(
width: textFieldWidth, width: textFieldWidth,
child: MyTextField( child: MIHTextField(
controller: medAidCodeController, controller: medAidCodeController,
hintText: "Code", hintText: "Code",
editable: false, editable: false,
@@ -148,7 +148,7 @@ class _PatientDetailsState extends State<PatientDetails> {
visible: req, visible: req,
child: SizedBox( child: SizedBox(
width: textFieldWidth, width: textFieldWidth,
child: MyTextField( child: MIHTextField(
controller: medNameController, controller: medNameController,
hintText: "Name", hintText: "Name",
editable: false, editable: false,
@@ -160,7 +160,7 @@ class _PatientDetailsState extends State<PatientDetails> {
visible: req, visible: req,
child: SizedBox( child: SizedBox(
width: textFieldWidth, width: textFieldWidth,
child: MyTextField( child: MIHTextField(
controller: medSchemeController, controller: medSchemeController,
hintText: "Scheme", hintText: "Scheme",
editable: false, editable: false,

View File

@@ -6,10 +6,10 @@ import 'package:flutter/material.dart';
import 'package:patient_manager/components/buildFilesList.dart'; import 'package:patient_manager/components/buildFilesList.dart';
import 'package:patient_manager/components/medCertInput.dart'; import 'package:patient_manager/components/medCertInput.dart';
import 'package:patient_manager/components/mihLoadingCircle.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/components/mySuccessMessage.dart'; import 'package:patient_manager/components/mihSuccessMessage.dart';
import 'package:patient_manager/components/myTextInput.dart'; import 'package:patient_manager/components/mihTextInput.dart';
import 'package:patient_manager/components/mybutton.dart'; import 'package:patient_manager/components/mihButton.dart';
import 'package:patient_manager/components/prescipInput.dart'; import 'package:patient_manager/components/prescipInput.dart';
import 'package:patient_manager/env/env.dart'; import 'package:patient_manager/env/env.dart';
import 'package:patient_manager/main.dart'; import 'package:patient_manager/main.dart';
@@ -229,7 +229,7 @@ class _PatientFilesState extends State<PatientFiles> {
showDialog( showDialog(
context: context, context: context,
builder: (context) { builder: (context) {
return MySuccessMessage( return MIHSuccessMessage(
successType: "Success", successType: "Success",
successMessage: message, successMessage: message,
); );
@@ -290,7 +290,7 @@ class _PatientFilesState extends State<PatientFiles> {
SizedBox( SizedBox(
width: 300, width: 300,
height: 100, height: 100,
child: MyButton( child: MIHButton(
buttonText: "Generate", buttonText: "Generate",
buttonColor: MzanziInnovationHub.of(context)! buttonColor: MzanziInnovationHub.of(context)!
.theme .theme
@@ -305,7 +305,7 @@ class _PatientFilesState extends State<PatientFiles> {
showDialog( showDialog(
context: context, context: context,
builder: (context) { builder: (context) {
return const MyErrorMessage( return const MIHErrorMessage(
errorType: "Input Error"); errorType: "Input Error");
}, },
); );
@@ -450,7 +450,7 @@ class _PatientFilesState extends State<PatientFiles> {
const SizedBox(height: 25.0), const SizedBox(height: 25.0),
SizedBox( SizedBox(
width: 700, width: 700,
child: MyButton( child: MIHButton(
buttonText: "Select File", buttonText: "Select File",
buttonColor: MzanziInnovationHub.of(context)! buttonColor: MzanziInnovationHub.of(context)!
.theme .theme
@@ -475,7 +475,7 @@ class _PatientFilesState extends State<PatientFiles> {
}, },
), ),
), ),
MyTextField( MIHTextField(
controller: selectedFileController, controller: selectedFileController,
hintText: "Selected FIle", hintText: "Selected FIle",
editable: false, editable: false,
@@ -484,7 +484,7 @@ class _PatientFilesState extends State<PatientFiles> {
SizedBox( SizedBox(
width: 300, width: 300,
height: 100, height: 100,
child: MyButton( child: MIHButton(
buttonText: "Add File", buttonText: "Add File",
buttonColor: MzanziInnovationHub.of(context)! buttonColor: MzanziInnovationHub.of(context)!
.theme .theme
@@ -499,7 +499,7 @@ class _PatientFilesState extends State<PatientFiles> {
showDialog( showDialog(
context: context, context: context,
builder: (context) { builder: (context) {
return const MyErrorMessage( return const MIHErrorMessage(
errorType: "Input Error"); errorType: "Input Error");
}, },
); );
@@ -536,7 +536,7 @@ class _PatientFilesState extends State<PatientFiles> {
showDialog( showDialog(
context: context, context: context,
builder: (context) { builder: (context) {
return const MyErrorMessage(errorType: "Internet Connection"); return const MIHErrorMessage(errorType: "Internet Connection");
}, },
); );
} }

View File

@@ -3,11 +3,11 @@ import 'dart:convert';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:patient_manager/components/buildNotesList.dart'; import 'package:patient_manager/components/buildNotesList.dart';
import 'package:patient_manager/components/mihLoadingCircle.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/components/myMLTextInput.dart'; import 'package:patient_manager/components/mihMLTextInput.dart';
import 'package:patient_manager/components/mySuccessMessage.dart'; import 'package:patient_manager/components/mihSuccessMessage.dart';
import 'package:patient_manager/components/myTextInput.dart'; import 'package:patient_manager/components/mihTextInput.dart';
import 'package:patient_manager/components/mybutton.dart'; import 'package:patient_manager/components/mihButton.dart';
import 'package:patient_manager/env/env.dart'; import 'package:patient_manager/env/env.dart';
import 'package:patient_manager/main.dart'; import 'package:patient_manager/main.dart';
import 'package:patient_manager/objects/appUser.dart'; import 'package:patient_manager/objects/appUser.dart';
@@ -81,7 +81,7 @@ class _PatientNotesState extends State<PatientNotes> {
showDialog( showDialog(
context: context, context: context,
builder: (context) { builder: (context) {
return MySuccessMessage( return MIHSuccessMessage(
successType: "Success", successType: "Success",
successMessage: message, successMessage: message,
); );
@@ -93,7 +93,7 @@ class _PatientNotesState extends State<PatientNotes> {
showDialog( showDialog(
context: context, context: context,
builder: (context) { builder: (context) {
return const MyErrorMessage(errorType: "Internet Connection"); return const MIHErrorMessage(errorType: "Internet Connection");
}, },
); );
} }
@@ -145,7 +145,7 @@ class _PatientNotesState extends State<PatientNotes> {
const SizedBox(height: 25.0), const SizedBox(height: 25.0),
SizedBox( SizedBox(
width: 700, width: 700,
child: MyTextField( child: MIHTextField(
controller: titleController, controller: titleController,
hintText: "Title of Note", hintText: "Title of Note",
editable: true, editable: true,
@@ -154,7 +154,7 @@ class _PatientNotesState extends State<PatientNotes> {
), ),
const SizedBox(height: 25.0), const SizedBox(height: 25.0),
Expanded( Expanded(
child: MyMLTextField( child: MIHMLTextField(
controller: noteTextController, controller: noteTextController,
hintText: "Note Details", hintText: "Note Details",
editable: true, editable: true,
@@ -164,7 +164,7 @@ class _PatientNotesState extends State<PatientNotes> {
SizedBox( SizedBox(
width: 300, width: 300,
height: 100, height: 100,
child: MyButton( child: MIHButton(
onTap: () { onTap: () {
if (isFieldsFilled()) { if (isFieldsFilled()) {
addPatientNoteAPICall(); addPatientNoteAPICall();
@@ -173,7 +173,7 @@ class _PatientNotesState extends State<PatientNotes> {
showDialog( showDialog(
context: context, context: context,
builder: (context) { builder: (context) {
return const MyErrorMessage( return const MIHErrorMessage(
errorType: "Input Error"); errorType: "Input Error");
}, },
); );

View File

@@ -1,9 +1,9 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:patient_manager/components/medicineSearch.dart'; import 'package:patient_manager/components/medicineSearch.dart';
import 'package:patient_manager/components/myDropdownInput.dart'; import 'package:patient_manager/components/mihDropdownInput.dart';
import 'package:patient_manager/components/myErrorMessage.dart'; import 'package:patient_manager/components/mihErrorMessage.dart';
import 'package:patient_manager/components/mySearchInput.dart'; import 'package:patient_manager/components/mihSearchInput.dart';
import 'package:patient_manager/components/mybutton.dart'; import 'package:patient_manager/components/mihButton.dart';
import 'package:patient_manager/main.dart'; import 'package:patient_manager/main.dart';
class PrescripInput extends StatefulWidget { class PrescripInput extends StatefulWidget {
@@ -126,7 +126,7 @@ class _PrescripInputState extends State<PrescripInput> {
children: [ children: [
SizedBox( SizedBox(
width: 300, width: 300,
child: MySearchField( child: MIHSearchField(
controller: widget.medicineController, controller: widget.medicineController,
hintText: "Medicine", hintText: "Medicine",
required: true, required: true,
@@ -139,7 +139,7 @@ class _PrescripInputState extends State<PrescripInput> {
const SizedBox(height: 25.0), const SizedBox(height: 25.0),
SizedBox( SizedBox(
width: 300, width: 300,
child: MyDropdownField( child: MIHDropdownField(
controller: widget.quantityController, controller: widget.quantityController,
hintText: "Quantity", hintText: "Quantity",
dropdownOptions: numberOptions, dropdownOptions: numberOptions,
@@ -150,7 +150,7 @@ class _PrescripInputState extends State<PrescripInput> {
const SizedBox(height: 25.0), const SizedBox(height: 25.0),
SizedBox( SizedBox(
width: 300, width: 300,
child: MyDropdownField( child: MIHDropdownField(
controller: widget.dosageController, controller: widget.dosageController,
hintText: "Dosage", hintText: "Dosage",
dropdownOptions: numberOptions, dropdownOptions: numberOptions,
@@ -161,7 +161,7 @@ class _PrescripInputState extends State<PrescripInput> {
const SizedBox(height: 25.0), const SizedBox(height: 25.0),
SizedBox( SizedBox(
width: 300, width: 300,
child: MyDropdownField( child: MIHDropdownField(
controller: widget.timesDailyController, controller: widget.timesDailyController,
hintText: "Times Daily", hintText: "Times Daily",
dropdownOptions: numberOptions, dropdownOptions: numberOptions,
@@ -172,7 +172,7 @@ class _PrescripInputState extends State<PrescripInput> {
const SizedBox(height: 25.0), const SizedBox(height: 25.0),
SizedBox( SizedBox(
width: 300, width: 300,
child: MyDropdownField( child: MIHDropdownField(
controller: widget.noDaysController, controller: widget.noDaysController,
hintText: "No. Days", hintText: "No. Days",
dropdownOptions: numberOptions, dropdownOptions: numberOptions,
@@ -183,7 +183,7 @@ class _PrescripInputState extends State<PrescripInput> {
const SizedBox(height: 25.0), const SizedBox(height: 25.0),
SizedBox( SizedBox(
width: 300, width: 300,
child: MyDropdownField( child: MIHDropdownField(
controller: widget.noRepeatsController, controller: widget.noRepeatsController,
hintText: "No. Repeats", hintText: "No. Repeats",
dropdownOptions: numberOptions, dropdownOptions: numberOptions,
@@ -193,7 +193,7 @@ class _PrescripInputState extends State<PrescripInput> {
), ),
SizedBox( SizedBox(
width: 300, width: 300,
child: MyButton( child: MIHButton(
buttonText: "Add", buttonText: "Add",
buttonColor: buttonColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(), MzanziInnovationHub.of(context)!.theme.secondaryColor(),
@@ -215,7 +215,7 @@ class _PrescripInputState extends State<PrescripInput> {
showDialog( showDialog(
context: context, context: context,
builder: (context) { builder: (context) {
return const MyErrorMessage(errorType: "Input Error"); return const MIHErrorMessage(errorType: "Input Error");
}, },
); );
} }
@@ -281,7 +281,7 @@ class _PrescripInputState extends State<PrescripInput> {
SizedBox( SizedBox(
width: 300, width: 300,
height: 100, height: 100,
child: MyButton( child: MIHButton(
onTap: () { onTap: () {
// if (isMedCertFieldsFilled()) { // if (isMedCertFieldsFilled()) {
// generateMedCert(); // generateMedCert();
@@ -290,7 +290,7 @@ class _PrescripInputState extends State<PrescripInput> {
// showDialog( // showDialog(
// context: context, // context: context,
// builder: (context) { // builder: (context) {
// return const MyErrorMessage( // return const MIHErrorMessage(
// errorType: "Input Error"); // errorType: "Input Error");
// }, // },
// ); // );

View File

@@ -2,11 +2,11 @@ import 'dart:convert';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:patient_manager/components/myDropdownInput.dart'; import 'package:patient_manager/components/mihDropdownInput.dart';
import 'package:patient_manager/components/myErrorMessage.dart'; import 'package:patient_manager/components/mihErrorMessage.dart';
import 'package:patient_manager/components/mySuccessMessage.dart'; import 'package:patient_manager/components/mihSuccessMessage.dart';
import 'package:patient_manager/components/myTextInput.dart'; import 'package:patient_manager/components/mihTextInput.dart';
import 'package:patient_manager/components/mybutton.dart'; import 'package:patient_manager/components/mihButton.dart';
import 'package:patient_manager/env/env.dart'; import 'package:patient_manager/env/env.dart';
import 'package:patient_manager/main.dart'; import 'package:patient_manager/main.dart';
import 'package:patient_manager/objects/appUser.dart'; import 'package:patient_manager/objects/appUser.dart';
@@ -114,7 +114,7 @@ class _AddPatientState extends State<AddPatient> {
showDialog( showDialog(
context: context, context: context,
builder: (context) { builder: (context) {
return const MyErrorMessage(errorType: "Internet Connection"); return const MIHErrorMessage(errorType: "Internet Connection");
}, },
); );
} }
@@ -134,7 +134,7 @@ class _AddPatientState extends State<AddPatient> {
showDialog( showDialog(
context: context, context: context,
builder: (context) { builder: (context) {
return MySuccessMessage( return MIHSuccessMessage(
successType: "Success", successType: "Success",
successMessage: message, successMessage: message,
); );
@@ -170,7 +170,7 @@ class _AddPatientState extends State<AddPatient> {
), ),
), ),
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
MyTextField( MIHTextField(
controller: idController, controller: idController,
hintText: "13 digit ID Number or Passport", hintText: "13 digit ID Number or Passport",
editable: true, editable: true,
@@ -178,7 +178,7 @@ class _AddPatientState extends State<AddPatient> {
), ),
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
MyTextField( MIHTextField(
controller: fnameController, controller: fnameController,
hintText: "First Name", hintText: "First Name",
editable: false, editable: false,
@@ -186,7 +186,7 @@ class _AddPatientState extends State<AddPatient> {
), ),
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
MyTextField( MIHTextField(
controller: lnameController, controller: lnameController,
hintText: "Last Name", hintText: "Last Name",
editable: false, editable: false,
@@ -195,7 +195,7 @@ class _AddPatientState extends State<AddPatient> {
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
MyTextField( MIHTextField(
controller: cellController, controller: cellController,
hintText: "Cell Number", hintText: "Cell Number",
editable: true, editable: true,
@@ -204,7 +204,7 @@ class _AddPatientState extends State<AddPatient> {
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
MyTextField( MIHTextField(
controller: emailController, controller: emailController,
hintText: "Email", hintText: "Email",
editable: false, editable: false,
@@ -213,7 +213,7 @@ class _AddPatientState extends State<AddPatient> {
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
MyTextField( MIHTextField(
controller: addressController, controller: addressController,
hintText: "Address", hintText: "Address",
editable: true, editable: true,
@@ -232,7 +232,7 @@ class _AddPatientState extends State<AddPatient> {
), ),
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
MyDropdownField( MIHDropdownField(
controller: medAidController, controller: medAidController,
hintText: "Medical Aid", hintText: "Medical Aid",
editable: true, editable: true,
@@ -247,7 +247,7 @@ class _AddPatientState extends State<AddPatient> {
child: Column( child: Column(
children: [ children: [
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
MyDropdownField( MIHDropdownField(
controller: medMainMemController, controller: medMainMemController,
hintText: "Main Member", hintText: "Main Member",
editable: medRequired, editable: medRequired,
@@ -255,28 +255,28 @@ class _AddPatientState extends State<AddPatient> {
dropdownOptions: const ["Yes", "No"], dropdownOptions: const ["Yes", "No"],
), ),
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
MyTextField( MIHTextField(
controller: medNoController, controller: medNoController,
hintText: "Medical Aid No.", hintText: "Medical Aid No.",
editable: medRequired, editable: medRequired,
required: medRequired, required: medRequired,
), ),
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
MyTextField( MIHTextField(
controller: medAidCodeController, controller: medAidCodeController,
hintText: "Medical Aid Code", hintText: "Medical Aid Code",
editable: medRequired, editable: medRequired,
required: medRequired, required: medRequired,
), ),
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
MyTextField( MIHTextField(
controller: medNameController, controller: medNameController,
hintText: "Medical Aid Name", hintText: "Medical Aid Name",
editable: medRequired, editable: medRequired,
required: medRequired, required: medRequired,
), ),
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
MyTextField( MIHTextField(
controller: medSchemeController, controller: medSchemeController,
hintText: "Medical Aid Scheme", hintText: "Medical Aid Scheme",
editable: medRequired, editable: medRequired,
@@ -291,7 +291,7 @@ class _AddPatientState extends State<AddPatient> {
SizedBox( SizedBox(
width: 450.0, width: 450.0,
height: 100.0, height: 100.0,
child: MyButton( child: MIHButton(
onTap: () { onTap: () {
submitForm(); submitForm();
}, },
@@ -313,7 +313,7 @@ class _AddPatientState extends State<AddPatient> {
showDialog( showDialog(
context: context, context: context,
builder: (context) { builder: (context) {
return const MyErrorMessage(errorType: "Input Error"); return const MIHErrorMessage(errorType: "Input Error");
}, },
); );
} }

View File

@@ -3,11 +3,11 @@ import 'dart:convert';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:patient_manager/components/mihAppBar.dart'; import 'package:patient_manager/components/mihAppBar.dart';
import 'package:patient_manager/components/myDropdownInput.dart'; import 'package:patient_manager/components/mihDropdownInput.dart';
import 'package:patient_manager/components/myErrorMessage.dart'; import 'package:patient_manager/components/mihErrorMessage.dart';
import 'package:patient_manager/components/mySuccessMessage.dart'; import 'package:patient_manager/components/mihSuccessMessage.dart';
import 'package:patient_manager/components/myTextInput.dart'; import 'package:patient_manager/components/mihTextInput.dart';
import 'package:patient_manager/components/mybutton.dart'; import 'package:patient_manager/components/mihButton.dart';
import 'package:patient_manager/env/env.dart'; import 'package:patient_manager/env/env.dart';
import 'package:patient_manager/main.dart'; import 'package:patient_manager/main.dart';
import 'package:patient_manager/objects/patients.dart'; import 'package:patient_manager/objects/patients.dart';
@@ -163,7 +163,7 @@ class _EditPatientState extends State<EditPatient> {
showDialog( showDialog(
context: context, context: context,
builder: (context) { builder: (context) {
return const MyErrorMessage(errorType: "Internet Connection"); return const MIHErrorMessage(errorType: "Internet Connection");
}, },
); );
} }
@@ -259,7 +259,7 @@ class _EditPatientState extends State<EditPatient> {
SizedBox( SizedBox(
width: 300, width: 300,
height: 100, height: 100,
child: MyButton( child: MIHButton(
onTap: deletePatientApiCall, onTap: deletePatientApiCall,
buttonText: "Delete", buttonText: "Delete",
buttonColor: MzanziInnovationHub.of(context)! buttonColor: MzanziInnovationHub.of(context)!
@@ -299,7 +299,7 @@ class _EditPatientState extends State<EditPatient> {
showDialog( showDialog(
context: context, context: context,
builder: (context) { builder: (context) {
return MySuccessMessage( return MIHSuccessMessage(
successType: "Success", successType: "Success",
successMessage: message, successMessage: message,
); );
@@ -382,7 +382,7 @@ class _EditPatientState extends State<EditPatient> {
], ],
), ),
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
MyTextField( MIHTextField(
controller: idController, controller: idController,
hintText: "13 digit ID Number or Passport", hintText: "13 digit ID Number or Passport",
editable: false, editable: false,
@@ -390,7 +390,7 @@ class _EditPatientState extends State<EditPatient> {
), ),
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
MyTextField( MIHTextField(
controller: fnameController, controller: fnameController,
hintText: "First Name", hintText: "First Name",
editable: false, editable: false,
@@ -398,7 +398,7 @@ class _EditPatientState extends State<EditPatient> {
), ),
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
MyTextField( MIHTextField(
controller: lnameController, controller: lnameController,
hintText: "Last Name", hintText: "Last Name",
editable: false, editable: false,
@@ -406,7 +406,7 @@ class _EditPatientState extends State<EditPatient> {
), ),
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
MyTextField( MIHTextField(
controller: cellController, controller: cellController,
hintText: "Cell Number", hintText: "Cell Number",
editable: true, editable: true,
@@ -414,7 +414,7 @@ class _EditPatientState extends State<EditPatient> {
), ),
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
MyTextField( MIHTextField(
controller: emailController, controller: emailController,
hintText: "Email", hintText: "Email",
editable: false, editable: false,
@@ -422,7 +422,7 @@ class _EditPatientState extends State<EditPatient> {
), ),
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
MyTextField( MIHTextField(
controller: addressController, controller: addressController,
hintText: "Address", hintText: "Address",
editable: true, editable: true,
@@ -440,7 +440,7 @@ class _EditPatientState extends State<EditPatient> {
), ),
), ),
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
MyDropdownField( MIHDropdownField(
controller: medAidController, controller: medAidController,
hintText: "Medical Aid", hintText: "Medical Aid",
onSelect: (selected) { onSelect: (selected) {
@@ -463,7 +463,7 @@ class _EditPatientState extends State<EditPatient> {
child: Column( child: Column(
children: [ children: [
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
MyDropdownField( MIHDropdownField(
controller: medMainMemController, controller: medMainMemController,
hintText: "Main Member.", hintText: "Main Member.",
editable: medRequired, editable: medRequired,
@@ -471,28 +471,28 @@ class _EditPatientState extends State<EditPatient> {
dropdownOptions: const ["Yes", "No"], dropdownOptions: const ["Yes", "No"],
), ),
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
MyTextField( MIHTextField(
controller: medNoController, controller: medNoController,
hintText: "Medical Aid No.", hintText: "Medical Aid No.",
editable: medRequired, editable: medRequired,
required: medRequired, required: medRequired,
), ),
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
MyTextField( MIHTextField(
controller: medAidCodeController, controller: medAidCodeController,
hintText: "Medical Aid Code", hintText: "Medical Aid Code",
editable: medRequired, editable: medRequired,
required: medRequired, required: medRequired,
), ),
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
MyTextField( MIHTextField(
controller: medNameController, controller: medNameController,
hintText: "Medical Aid Name", hintText: "Medical Aid Name",
editable: medRequired, editable: medRequired,
required: medRequired, required: medRequired,
), ),
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
MyTextField( MIHTextField(
controller: medSchemeController, controller: medSchemeController,
hintText: "Medical Aid Scheme", hintText: "Medical Aid Scheme",
editable: medRequired, editable: medRequired,
@@ -506,7 +506,7 @@ class _EditPatientState extends State<EditPatient> {
SizedBox( SizedBox(
width: 500.0, width: 500.0,
height: 100.0, height: 100.0,
child: MyButton( child: MIHButton(
onTap: () { onTap: () {
submitForm(); submitForm();
}, },
@@ -537,7 +537,7 @@ class _EditPatientState extends State<EditPatient> {
showDialog( showDialog(
context: context, context: context,
builder: (context) { builder: (context) {
return const MyErrorMessage(errorType: "Input Error"); return const MIHErrorMessage(errorType: "Input Error");
}, },
); );
} }

View File

@@ -8,12 +8,12 @@ import 'package:patient_manager/components/buildPatientList.dart';
import 'package:patient_manager/components/buildPatientQueueList.dart'; import 'package:patient_manager/components/buildPatientQueueList.dart';
import 'package:patient_manager/components/mihAppBar.dart'; import 'package:patient_manager/components/mihAppBar.dart';
import 'package:patient_manager/components/mihLoadingCircle.dart'; import 'package:patient_manager/components/mihLoadingCircle.dart';
import 'package:patient_manager/components/myDateInput.dart'; import 'package:patient_manager/components/mihDateInput.dart';
import 'package:patient_manager/components/myErrorMessage.dart'; import 'package:patient_manager/components/mihErrorMessage.dart';
import 'package:patient_manager/objects/arguments.dart'; import 'package:patient_manager/objects/arguments.dart';
import 'package:patient_manager/objects/patientQueue.dart'; import 'package:patient_manager/objects/patientQueue.dart';
import 'package:supertokens_flutter/http.dart' as http; 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/env/env.dart';
import 'package:patient_manager/main.dart'; import 'package:patient_manager/main.dart';
import 'package:patient_manager/objects/patients.dart'; import 'package:patient_manager/objects/patients.dart';
@@ -177,7 +177,7 @@ class _PatientManagerState extends State<PatientManager> {
), ),
//spacer //spacer
const SizedBox(height: 10), const SizedBox(height: 10),
MySearchField( MIHSearchField(
controller: searchController, controller: searchController,
hintText: "ID or Medical Aid No. Search", hintText: "ID or Medical Aid No. Search",
required: true, required: true,
@@ -304,7 +304,7 @@ class _PatientManagerState extends State<PatientManager> {
style: TextStyle(fontSize: 25, fontWeight: FontWeight.bold), style: TextStyle(fontSize: 25, fontWeight: FontWeight.bold),
), ),
const SizedBox(height: 10), const SizedBox(height: 10),
MyDateField( MIHDateField(
controller: queueDateController, controller: queueDateController,
LableText: "Date", LableText: "Date",
required: true, required: true,
@@ -383,7 +383,7 @@ class _PatientManagerState extends State<PatientManager> {
showDialog( showDialog(
context: context, context: context,
builder: (context) { builder: (context) {
return const MyErrorMessage(errorType: "Input Error"); return const MIHErrorMessage(errorType: "Input Error");
}, },
); );
} }

View File

@@ -4,12 +4,12 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:patient_manager/components/mihAppBar.dart'; import 'package:patient_manager/components/mihAppBar.dart';
import 'package:patient_manager/components/mihLoadingCircle.dart'; import 'package:patient_manager/components/mihLoadingCircle.dart';
import 'package:patient_manager/components/myDropdownInput.dart'; import 'package:patient_manager/components/mihDropdownInput.dart';
import 'package:patient_manager/components/myErrorMessage.dart'; import 'package:patient_manager/components/mihErrorMessage.dart';
import 'package:patient_manager/components/myFileInput.dart'; import 'package:patient_manager/components/mihFileInput.dart';
import 'package:patient_manager/components/mySuccessMessage.dart'; import 'package:patient_manager/components/mihSuccessMessage.dart';
import 'package:patient_manager/components/myTextInput.dart'; import 'package:patient_manager/components/mihTextInput.dart';
import 'package:patient_manager/components/mybutton.dart'; import 'package:patient_manager/components/mihButton.dart';
import 'package:patient_manager/env/env.dart'; import 'package:patient_manager/env/env.dart';
import 'package:patient_manager/main.dart'; import 'package:patient_manager/main.dart';
import 'package:patient_manager/objects/appUser.dart'; import 'package:patient_manager/objects/appUser.dart';
@@ -128,7 +128,7 @@ class _ProfileBusinessAddState extends State<ProfileBusinessAdd> {
showDialog( showDialog(
context: context, context: context,
builder: (context) { builder: (context) {
return const MyErrorMessage(errorType: "Internet Connection"); return const MIHErrorMessage(errorType: "Internet Connection");
}, },
); );
} }
@@ -137,7 +137,7 @@ class _ProfileBusinessAddState extends State<ProfileBusinessAdd> {
showDialog( showDialog(
context: context, context: context,
builder: (context) { builder: (context) {
return MySuccessMessage( return MIHSuccessMessage(
successType: "Success", successType: "Success",
successMessage: message, successMessage: message,
); );
@@ -184,21 +184,21 @@ class _ProfileBusinessAddState extends State<ProfileBusinessAdd> {
), ),
), ),
const SizedBox(height: 15.0), const SizedBox(height: 15.0),
MyTextField( MIHTextField(
controller: regController, controller: regController,
hintText: "Registration No.", hintText: "Registration No.",
editable: true, editable: true,
required: true, required: true,
), ),
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
MyTextField( MIHTextField(
controller: nameController, controller: nameController,
hintText: "Business Name", hintText: "Business Name",
editable: true, editable: true,
required: true, required: true,
), ),
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
MyDropdownField( MIHDropdownField(
controller: typeController, controller: typeController,
hintText: "Business Type", hintText: "Business Type",
dropdownOptions: const ["Doctors Office", "Other"], dropdownOptions: const ["Doctors Office", "Other"],
@@ -206,7 +206,7 @@ class _ProfileBusinessAddState extends State<ProfileBusinessAdd> {
editable: true, editable: true,
), ),
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
MyFileField( MIHFileField(
controller: logonameController, controller: logonameController,
hintText: "Logo", hintText: "Logo",
editable: false, editable: false,
@@ -240,7 +240,7 @@ class _ProfileBusinessAddState extends State<ProfileBusinessAdd> {
), ),
), ),
const SizedBox(height: 15.0), const SizedBox(height: 15.0),
MyDropdownField( MIHDropdownField(
controller: titleController, controller: titleController,
hintText: "Title", hintText: "Title",
dropdownOptions: const ["Doctor", "Assistant"], dropdownOptions: const ["Doctor", "Assistant"],
@@ -248,21 +248,21 @@ class _ProfileBusinessAddState extends State<ProfileBusinessAdd> {
editable: true, editable: true,
), ),
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
MyTextField( MIHTextField(
controller: fnameController, controller: fnameController,
hintText: "Name", hintText: "Name",
editable: false, editable: false,
required: true, required: true,
), ),
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
MyTextField( MIHTextField(
controller: lnameController, controller: lnameController,
hintText: "Surname", hintText: "Surname",
editable: false, editable: false,
required: true, required: true,
), ),
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
MyFileField( MIHFileField(
controller: signtureController, controller: signtureController,
hintText: "Signature", hintText: "Signature",
editable: false, editable: false,
@@ -284,7 +284,7 @@ class _ProfileBusinessAddState extends State<ProfileBusinessAdd> {
}, },
), ),
const SizedBox(height: 15.0), const SizedBox(height: 15.0),
MyDropdownField( MIHDropdownField(
controller: accessController, controller: accessController,
hintText: "Access", hintText: "Access",
dropdownOptions: const ["Full", "Partial"], dropdownOptions: const ["Full", "Partial"],
@@ -295,7 +295,7 @@ class _ProfileBusinessAddState extends State<ProfileBusinessAdd> {
SizedBox( SizedBox(
width: 500.0, width: 500.0,
height: 100.0, height: 100.0,
child: MyButton( child: MIHButton(
buttonText: "Add", buttonText: "Add",
buttonColor: buttonColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(), MzanziInnovationHub.of(context)!.theme.secondaryColor(),

View File

@@ -5,12 +5,12 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:patient_manager/components/mihAppBar.dart'; import 'package:patient_manager/components/mihAppBar.dart';
import 'package:patient_manager/components/mihLoadingCircle.dart'; import 'package:patient_manager/components/mihLoadingCircle.dart';
import 'package:patient_manager/components/myDropdownInput.dart'; import 'package:patient_manager/components/mihDropdownInput.dart';
import 'package:patient_manager/components/myErrorMessage.dart'; import 'package:patient_manager/components/mihErrorMessage.dart';
import 'package:patient_manager/components/myFileInput.dart'; import 'package:patient_manager/components/mihFileInput.dart';
import 'package:patient_manager/components/mySuccessMessage.dart'; import 'package:patient_manager/components/mihSuccessMessage.dart';
import 'package:patient_manager/components/myTextInput.dart'; import 'package:patient_manager/components/mihTextInput.dart';
import 'package:patient_manager/components/mybutton.dart'; import 'package:patient_manager/components/mihButton.dart';
import 'package:patient_manager/env/env.dart'; import 'package:patient_manager/env/env.dart';
import 'package:patient_manager/main.dart'; import 'package:patient_manager/main.dart';
import 'package:patient_manager/objects/arguments.dart'; import 'package:patient_manager/objects/arguments.dart';
@@ -196,7 +196,7 @@ class _ProfileBusinessUpdateState extends State<ProfileBusinessUpdate> {
showDialog( showDialog(
context: context, context: context,
builder: (context) { builder: (context) {
return const MyErrorMessage(errorType: "Internet Connection"); return const MIHErrorMessage(errorType: "Internet Connection");
}, },
); );
} }
@@ -205,7 +205,7 @@ class _ProfileBusinessUpdateState extends State<ProfileBusinessUpdate> {
showDialog( showDialog(
context: context, context: context,
builder: (context) { builder: (context) {
return MySuccessMessage( return MIHSuccessMessage(
successType: "Success", successType: "Success",
successMessage: message, successMessage: message,
); );
@@ -270,21 +270,21 @@ class _ProfileBusinessUpdateState extends State<ProfileBusinessUpdate> {
), ),
), ),
const SizedBox(height: 15.0), const SizedBox(height: 15.0),
MyTextField( MIHTextField(
controller: regController, controller: regController,
hintText: "Registration No.", hintText: "Registration No.",
editable: true, editable: true,
required: true, required: true,
), ),
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
MyTextField( MIHTextField(
controller: nameController, controller: nameController,
hintText: "Business Name", hintText: "Business Name",
editable: true, editable: true,
required: true, required: true,
), ),
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
MyDropdownField( MIHDropdownField(
controller: typeController, controller: typeController,
hintText: "Business Type", hintText: "Business Type",
dropdownOptions: const ["Doctors Office", "Other"], dropdownOptions: const ["Doctors Office", "Other"],
@@ -292,7 +292,7 @@ class _ProfileBusinessUpdateState extends State<ProfileBusinessUpdate> {
editable: true, editable: true,
), ),
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
MyFileField( MIHFileField(
controller: logonameController, controller: logonameController,
hintText: "Logo", hintText: "Logo",
editable: false, editable: false,
@@ -331,7 +331,7 @@ class _ProfileBusinessUpdateState extends State<ProfileBusinessUpdate> {
), ),
), ),
const SizedBox(height: 15.0), const SizedBox(height: 15.0),
MyDropdownField( MIHDropdownField(
controller: titleController, controller: titleController,
hintText: "Title", hintText: "Title",
dropdownOptions: const ["Doctor", "Assistant"], dropdownOptions: const ["Doctor", "Assistant"],
@@ -339,21 +339,21 @@ class _ProfileBusinessUpdateState extends State<ProfileBusinessUpdate> {
editable: true, editable: true,
), ),
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
MyTextField( MIHTextField(
controller: fnameController, controller: fnameController,
hintText: "Name", hintText: "Name",
editable: false, editable: false,
required: true, required: true,
), ),
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
MyTextField( MIHTextField(
controller: lnameController, controller: lnameController,
hintText: "Surname", hintText: "Surname",
editable: false, editable: false,
required: true, required: true,
), ),
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
MyFileField( MIHFileField(
controller: signtureController, controller: signtureController,
hintText: "Signature", hintText: "Signature",
editable: false, editable: false,
@@ -375,7 +375,7 @@ class _ProfileBusinessUpdateState extends State<ProfileBusinessUpdate> {
}, },
), ),
const SizedBox(height: 15.0), const SizedBox(height: 15.0),
MyDropdownField( MIHDropdownField(
controller: accessController, controller: accessController,
hintText: "Access", hintText: "Access",
dropdownOptions: const ["Full", "Partial"], dropdownOptions: const ["Full", "Partial"],
@@ -386,7 +386,7 @@ class _ProfileBusinessUpdateState extends State<ProfileBusinessUpdate> {
SizedBox( SizedBox(
width: 500.0, width: 500.0,
height: 100.0, height: 100.0,
child: MyButton( child: MIHButton(
buttonText: "Add", buttonText: "Add",
buttonColor: MzanziInnovationHub.of(context)! buttonColor: MzanziInnovationHub.of(context)!
.theme .theme

View File

@@ -3,10 +3,10 @@ import 'dart:convert';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:patient_manager/components/mihAppBar.dart'; import 'package:patient_manager/components/mihAppBar.dart';
import 'package:patient_manager/components/myErrorMessage.dart'; import 'package:patient_manager/components/mihErrorMessage.dart';
import 'package:patient_manager/components/mySuccessMessage.dart'; import 'package:patient_manager/components/mihSuccessMessage.dart';
import 'package:patient_manager/components/myTextInput.dart'; import 'package:patient_manager/components/mihTextInput.dart';
import 'package:patient_manager/components/mybutton.dart'; import 'package:patient_manager/components/mihButton.dart';
import 'package:patient_manager/env/env.dart'; import 'package:patient_manager/env/env.dart';
import 'package:patient_manager/main.dart'; import 'package:patient_manager/main.dart';
import 'package:patient_manager/objects/appUser.dart'; import 'package:patient_manager/objects/appUser.dart';
@@ -98,7 +98,7 @@ class _ProfileUserUpdateState extends State<ProfileUserUpdate> {
showDialog( showDialog(
context: context, context: context,
builder: (context) { builder: (context) {
return const MyErrorMessage(errorType: "Internet Connection"); return const MIHErrorMessage(errorType: "Internet Connection");
}, },
); );
} }
@@ -107,7 +107,7 @@ class _ProfileUserUpdateState extends State<ProfileUserUpdate> {
showDialog( showDialog(
context: context, context: context,
builder: (context) { builder: (context) {
return MySuccessMessage( return MIHSuccessMessage(
successType: "Success", successType: "Success",
successMessage: message, successMessage: message,
); );
@@ -119,7 +119,7 @@ class _ProfileUserUpdateState extends State<ProfileUserUpdate> {
showDialog( showDialog(
context: context, context: context,
builder: (context) { builder: (context) {
return const MyErrorMessage(errorType: "Invalid Username"); return const MIHErrorMessage(errorType: "Invalid Username");
}, },
); );
} }
@@ -136,7 +136,7 @@ class _ProfileUserUpdateState extends State<ProfileUserUpdate> {
showDialog( showDialog(
context: context, context: context,
builder: (context) { builder: (context) {
return const MyErrorMessage(errorType: "Input Error"); return const MIHErrorMessage(errorType: "Input Error");
}, },
); );
} }
@@ -180,21 +180,21 @@ class _ProfileUserUpdateState extends State<ProfileUserUpdate> {
), ),
), ),
const SizedBox(height: 15.0), const SizedBox(height: 15.0),
MyTextField( MIHTextField(
controller: usernameController, controller: usernameController,
hintText: "Username", hintText: "Username",
editable: true, editable: true,
required: true, required: true,
), ),
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
MyTextField( MIHTextField(
controller: fnameController, controller: fnameController,
hintText: "First Name", hintText: "First Name",
editable: true, editable: true,
required: true, required: true,
), ),
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
MyTextField( MIHTextField(
controller: lnameController, controller: lnameController,
hintText: "Last Name", hintText: "Last Name",
editable: true, editable: true,
@@ -229,7 +229,7 @@ class _ProfileUserUpdateState extends State<ProfileUserUpdate> {
SizedBox( SizedBox(
width: 500.0, width: 500.0,
height: 100.0, height: 100.0,
child: MyButton( child: MIHButton(
buttonText: "Update", buttonText: "Update",
buttonColor: buttonColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(), MzanziInnovationHub.of(context)!.theme.secondaryColor(),

View File

@@ -3,11 +3,11 @@ import 'dart:convert';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:patient_manager/components/mihLoadingCircle.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/components/myPassInput.dart'; import 'package:patient_manager/components/mihPassInput.dart';
import 'package:patient_manager/components/mySuccessMessage.dart'; import 'package:patient_manager/components/mihSuccessMessage.dart';
import 'package:patient_manager/components/myTextInput.dart'; import 'package:patient_manager/components/mihTextInput.dart';
import 'package:patient_manager/components/mybutton.dart'; import 'package:patient_manager/components/mihButton.dart';
import 'package:patient_manager/env/env.dart'; import 'package:patient_manager/env/env.dart';
import 'package:patient_manager/main.dart'; import 'package:patient_manager/main.dart';
//import 'package:patient_manager/objects/sessionST.dart'; //import 'package:patient_manager/objects/sessionST.dart';
@@ -139,7 +139,7 @@ class _RegisterState extends State<Register> {
showDialog( showDialog(
context: context, context: context,
builder: (context) { builder: (context) {
return const MyErrorMessage(errorType: "Internet Connection"); return const MIHErrorMessage(errorType: "Internet Connection");
}, },
); );
} }
@@ -148,7 +148,7 @@ class _RegisterState extends State<Register> {
showDialog( showDialog(
context: context, context: context,
builder: (context) { builder: (context) {
return const MySuccessMessage( return const MIHSuccessMessage(
successType: "Success", successType: "Success",
successMessage: 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."); "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<Register> {
showDialog( showDialog(
context: context, context: context,
builder: (context) { builder: (context) {
return const MyErrorMessage(errorType: "User Exists"); return const MIHErrorMessage(errorType: "User Exists");
}, },
); );
} }
@@ -169,7 +169,7 @@ class _RegisterState extends State<Register> {
showDialog( showDialog(
context: context, context: context,
builder: (context) { builder: (context) {
return const MyErrorMessage(errorType: "Password Match"); return const MIHErrorMessage(errorType: "Password Match");
}, },
); );
} }
@@ -178,7 +178,7 @@ class _RegisterState extends State<Register> {
showDialog( showDialog(
context: context, context: context,
builder: (context) { builder: (context) {
return const MyErrorMessage(errorType: "Invalid Email"); return const MIHErrorMessage(errorType: "Invalid Email");
}, },
); );
} }
@@ -187,7 +187,7 @@ class _RegisterState extends State<Register> {
showDialog( showDialog(
context: context, context: context,
builder: (context) { builder: (context) {
return const MyErrorMessage(errorType: "Password Requirements"); return const MIHErrorMessage(errorType: "Password Requirements");
}, },
); );
} }
@@ -210,7 +210,7 @@ class _RegisterState extends State<Register> {
showDialog( showDialog(
context: context, context: context,
builder: (context) { builder: (context) {
return const MyErrorMessage(errorType: "Input Error"); return const MIHErrorMessage(errorType: "Input Error");
}, },
); );
} else { } else {
@@ -272,7 +272,7 @@ class _RegisterState extends State<Register> {
//email input //email input
SizedBox( SizedBox(
width: 500.0, width: 500.0,
child: MyTextField( child: MIHTextField(
controller: emailController, controller: emailController,
hintText: 'Email', hintText: 'Email',
editable: true, editable: true,
@@ -284,7 +284,7 @@ class _RegisterState extends State<Register> {
//password input //password input
SizedBox( SizedBox(
width: 500.0, width: 500.0,
child: MyPassField( child: MIHPassField(
controller: passwordController, controller: passwordController,
hintText: 'Password', hintText: 'Password',
required: true, required: true,
@@ -296,7 +296,7 @@ class _RegisterState extends State<Register> {
//password input //password input
SizedBox( SizedBox(
width: 500.0, width: 500.0,
child: MyPassField( child: MIHPassField(
controller: confirmPasswordController, controller: confirmPasswordController,
hintText: 'Confirm Password', hintText: 'Confirm Password',
required: true, required: true,
@@ -309,7 +309,7 @@ class _RegisterState extends State<Register> {
SizedBox( SizedBox(
width: 500.0, width: 500.0,
height: 100.0, height: 100.0,
child: MyButton( child: MIHButton(
buttonText: "Sign Up", buttonText: "Sign Up",
buttonColor: MzanziInnovationHub.of(context)! buttonColor: MzanziInnovationHub.of(context)!
.theme .theme

View File

@@ -3,10 +3,10 @@ import 'dart:convert';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:patient_manager/components/mihLoadingCircle.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/components/myPassInput.dart'; import 'package:patient_manager/components/mihPassInput.dart';
import 'package:patient_manager/components/myTextInput.dart'; import 'package:patient_manager/components/mihTextInput.dart';
import 'package:patient_manager/components/mybutton.dart'; import 'package:patient_manager/components/mihButton.dart';
import 'package:patient_manager/env/env.dart'; import 'package:patient_manager/env/env.dart';
import 'package:patient_manager/main.dart'; import 'package:patient_manager/main.dart';
import 'package:supabase_auth_ui/supabase_auth_ui.dart'; import 'package:supabase_auth_ui/supabase_auth_ui.dart';
@@ -79,7 +79,7 @@ class _SignInState extends State<SignIn> {
showDialog( showDialog(
context: context, context: context,
builder: (context) { builder: (context) {
return const MyErrorMessage(errorType: "Invalid Credentials"); return const MIHErrorMessage(errorType: "Invalid Credentials");
}, },
); );
} }
@@ -89,7 +89,7 @@ class _SignInState extends State<SignIn> {
showDialog( showDialog(
context: context, context: context,
builder: (context) { builder: (context) {
return const MyErrorMessage(errorType: "Input Error"); return const MIHErrorMessage(errorType: "Input Error");
}, },
); );
} else { } else {
@@ -148,7 +148,7 @@ class _SignInState extends State<SignIn> {
//email input //email input
SizedBox( SizedBox(
width: 500.0, width: 500.0,
child: MyTextField( child: MIHTextField(
controller: emailController, controller: emailController,
hintText: 'Email', hintText: 'Email',
editable: true, editable: true,
@@ -160,7 +160,7 @@ class _SignInState extends State<SignIn> {
//password input //password input
SizedBox( SizedBox(
width: 500.0, width: 500.0,
child: MyPassField( child: MIHPassField(
controller: passwordController, controller: passwordController,
hintText: 'Password', hintText: 'Password',
required: true, required: true,
@@ -173,7 +173,7 @@ class _SignInState extends State<SignIn> {
SizedBox( SizedBox(
width: 500.0, width: 500.0,
height: 100.0, height: 100.0,
child: MyButton( child: MIHButton(
buttonText: "Sign In", buttonText: "Sign In",
buttonColor: MzanziInnovationHub.of(context)! buttonColor: MzanziInnovationHub.of(context)!
.theme .theme