rename files and widgets from my... to mih...
This commit is contained in:
@@ -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<Patient> patients;
|
||||
@@ -20,6 +20,104 @@ class BuildPatientsList extends StatefulWidget {
|
||||
}
|
||||
|
||||
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) {
|
||||
//var matchRE = RegExp(r'^[a-z]+$');
|
||||
var firstLetterFName = widget.patients[index].first_name[0];
|
||||
@@ -91,9 +189,9 @@ class _BuildPatientsListState extends State<BuildPatientsList> {
|
||||
),
|
||||
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(
|
||||
|
||||
Reference in New Issue
Block a user