Merge branch 'pesrcription-post' into 'development'

Pesrcription post

See merge request Cloud_Solution/doctor_app_flutter!221
merge-requests/222/merge
Mohammad Aljammal 5 years ago
commit 0e34f60cad

@ -1,7 +1,7 @@
class MedicalFileModel { class MedicalFileModel {
List<EntityList> entityList; List<EntityList> entityList;
int rowcount; int rowcount;
dynamic statusMessage; Null statusMessage;
MedicalFileModel({this.entityList, this.rowcount, this.statusMessage}); MedicalFileModel({this.entityList, this.rowcount, this.statusMessage});
@ -190,12 +190,12 @@ class LstDischargeDiag {
projectName = json['ProjectName']; projectName = json['ProjectName'];
remarks = json['Remarks']; remarks = json['Remarks'];
setupID = json['SetupID']; setupID = json['SetupID'];
// if (json['TimeLineEvents'] != null) { if (json['TimeLineEvents'] != null) {
// timeLineEvents = new List<TimeLineEvents>(); timeLineEvents = new List<TimeLineEvents>();
// json['TimeLineEvents'].forEach((v) { json['TimeLineEvents'].forEach((v) {
// timeLineEvents.add(new TimeLineEvents.fromJson(v)); timeLineEvents.add(new TimeLineEvents.fromJson(v));
// }); });
// } }
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -246,49 +246,49 @@ class TimeLineEvents {
this.radReports, this.radReports,
this.toolTip}); this.toolTip});
// TimeLineEvents.fromJson(Map<String, dynamic> json) { TimeLineEvents.fromJson(Map<String, dynamic> json) {
// if (json['Admissions'] != null) { // if (json['Admissions'] != null) {
// admissions = new List<Null>(); // admissions = new List<Null>();
// json['Admissions'].forEach((v) { // json['Admissions'].forEach((v) {
// admissions.add(new Null.fromJson(v)); // admissions.add(new Null.fromJson(v));
// }); // });
// } // }
// colorClass = json['ColorClass']; // colorClass = json['ColorClass'];
// if (json['Consulations'] != null) { // if (json['Consulations'] != null) {
// consulations = new List<Null>(); // consulations = new List<Null>();
// json['Consulations'].forEach((v) { // json['Consulations'].forEach((v) {
// consulations.add(new Null.fromJson(v)); // consulations.add(new Null.fromJson(v));
// }); // });
// } // }
// disPlayName = json['DisPlayName']; disPlayName = json['DisPlayName'];
// doctorName = json['DoctorName']; doctorName = json['DoctorName'];
// eRData = eRData =
// json['ERData'] != null ? new ERData.fromJson(json['ERData']) : null; json['ERData'] != null ? new ERData.fromJson(json['ERData']) : null;
// eventId = json['EventId']; eventId = json['EventId'];
// fullName = json['FullName']; fullName = json['FullName'];
// iconClass = json['IconClass']; iconClass = json['IconClass'];
// isDisabled = json['IsDisabled']; isDisabled = json['IsDisabled'];
// if (json['LabOrders'] != null) { // if (json['LabOrders'] != null) {
// labOrders = new List<Null>(); // labOrders = new List<Null>();
// json['LabOrders'].forEach((v) { // json['LabOrders'].forEach((v) {
// labOrders.add(new Null.fromJson(v)); // labOrders.add(new Null.fromJson(v));
// }); // });
// } // }
// if (json['RadReports'] != null) { // if (json['RadReports'] != null) {
// radReports = new List<Null>(); // radReports = new List<Null>();
// json['RadReports'].forEach((v) { // json['RadReports'].forEach((v) {
// radReports.add(new Null.fromJson(v)); // radReports.add(new Null.fromJson(v));
// }); // });
// } // }
// toolTip = json['ToolTip']; toolTip = json['ToolTip'];
// } }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
// if (this.admissions != null) { // if (this.admissions != null) {
// data['Admissions'] = this.admissions.map((v) => v.toJson()).toList(); // data['Admissions'] = this.admissions.map((v) => v.toJson()).toList();
// } // }
data['ColorClass'] = this.colorClass; // data['ColorClass'] = this.colorClass;
// if (this.consulations != null) { // if (this.consulations != null) {
// data['Consulations'] = this.consulations.map((v) => v.toJson()).toList(); // data['Consulations'] = this.consulations.map((v) => v.toJson()).toList();
// } // }
@ -326,38 +326,38 @@ class ERData {
this.radReports, this.radReports,
this.lstErDischargeSummary}); this.lstErDischargeSummary});
// ERData.fromJson(Map<String, dynamic> json) { ERData.fromJson(Map<String, dynamic> json) {
// if (json['Admissions'] != null) { // if (json['Admissions'] != null) {
// admissions = new List<Null>(); // admissions = new List<Null>();
// json['Admissions'].forEach((v) { // json['Admissions'].forEach((v) {
// admissions.add(new Null.fromJson(v)); // admissions.add(new Null.fromJson(v));
// }); // });
// } // }
// if (json['Consulations'] != null) { // if (json['Consulations'] != null) {
// consulations = new List<Null>(); // consulations = new List<Null>();
// json['Consulations'].forEach((v) { // json['Consulations'].forEach((v) {
// consulations.add(new Null.fromJson(v)); // consulations.add(new Null.fromJson(v));
// }); // });
// } // }
// if (json['LabOrders'] != null) { // if (json['LabOrders'] != null) {
// labOrders = new List<Null>(); // labOrders = new List<Null>();
// json['LabOrders'].forEach((v) { // json['LabOrders'].forEach((v) {
// labOrders.add(new Null.fromJson(v)); // labOrders.add(new Null.fromJson(v));
// }); // });
// } // }
// if (json['RadReports'] != null) { // if (json['RadReports'] != null) {
// radReports = new List<Null>(); // radReports = new List<Null>();
// json['RadReports'].forEach((v) { // json['RadReports'].forEach((v) {
// radReports.add(new Null.fromJson(v)); // radReports.add(new Null.fromJson(v));
// }); // });
// } // }
// if (json['lstErDischargeSummary'] != null) { // if (json['lstErDischargeSummary'] != null) {
// lstErDischargeSummary = new List<Null>(); // lstErDischargeSummary = new List<Null>();
// json['lstErDischargeSummary'].forEach((v) { // json['lstErDischargeSummary'].forEach((v) {
// lstErDischargeSummary.add(new Null.fromJson(v)); // lstErDischargeSummary.add(new Null.fromJson(v));
// }); // });
// } // }
// } }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
@ -827,6 +827,7 @@ class DoctorWisePatientEpisodes {
String setupID; String setupID;
int doctorID; int doctorID;
String doctorName; String doctorName;
List<LstEpisodes> lstEpisodes;
DoctorWisePatientEpisodes( DoctorWisePatientEpisodes(
{this.clinicName, {this.clinicName,
@ -835,7 +836,8 @@ class DoctorWisePatientEpisodes {
this.projectName, this.projectName,
this.setupID, this.setupID,
this.doctorID, this.doctorID,
this.doctorName}); this.doctorName,
this.lstEpisodes});
DoctorWisePatientEpisodes.fromJson(Map<String, dynamic> json) { DoctorWisePatientEpisodes.fromJson(Map<String, dynamic> json) {
clinicName = json['ClinicName']; clinicName = json['ClinicName'];
@ -845,6 +847,12 @@ class DoctorWisePatientEpisodes {
setupID = json['SetupID']; setupID = json['SetupID'];
doctorID = json['doctorID']; doctorID = json['doctorID'];
doctorName = json['doctorName']; doctorName = json['doctorName'];
if (json['lstEpisodes'] != null) {
lstEpisodes = new List<LstEpisodes>();
json['lstEpisodes'].forEach((v) {
lstEpisodes.add(new LstEpisodes.fromJson(v));
});
}
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -856,6 +864,256 @@ class DoctorWisePatientEpisodes {
data['SetupID'] = this.setupID; data['SetupID'] = this.setupID;
data['doctorID'] = this.doctorID; data['doctorID'] = this.doctorID;
data['doctorName'] = this.doctorName; data['doctorName'] = this.doctorName;
if (this.lstEpisodes != null) {
data['lstEpisodes'] = this.lstEpisodes.map((v) => v.toJson()).toList();
}
return data;
}
}
class LstEpisodes {
int admissionNo;
String appointmentDate;
int appointmentNo;
String appointmentType;
String clinicID;
String clinicName;
int doctorID;
String doctorName;
String endTime;
String episodeDate;
int episodeID;
int patientID;
int projectID;
String projectName;
String remarks;
String setupID;
String startTime;
String visitFor;
String visitType;
String dispalyName;
List<LstAssessments> lstAssessments;
List<LstPhysicalExam> lstPhysicalExam;
LstEpisodes(
{this.admissionNo,
this.appointmentDate,
this.appointmentNo,
this.appointmentType,
this.clinicID,
this.clinicName,
this.doctorID,
this.doctorName,
this.endTime,
this.episodeDate,
this.episodeID,
this.patientID,
this.projectID,
this.projectName,
this.remarks,
this.setupID,
this.startTime,
this.visitFor,
this.visitType,
this.dispalyName,
this.lstAssessments,
this.lstPhysicalExam});
LstEpisodes.fromJson(Map<String, dynamic> json) {
admissionNo = json['AdmissionNo'];
appointmentDate = json['AppointmentDate'];
appointmentNo = json['AppointmentNo'];
appointmentType = json['AppointmentType'];
clinicID = json['ClinicID'];
clinicName = json['ClinicName'];
doctorID = json['DoctorID'];
doctorName = json['DoctorName'];
endTime = json['EndTime'];
episodeDate = json['EpisodeDate'];
episodeID = json['EpisodeID'];
patientID = json['PatientID'];
projectID = json['ProjectID'];
projectName = json['ProjectName'];
remarks = json['Remarks'];
setupID = json['SetupID'];
startTime = json['StartTime'];
visitFor = json['VisitFor'];
visitType = json['VisitType'];
dispalyName = json['dispalyName'];
if (json['lstAssessments'] != null) {
lstAssessments = new List<LstAssessments>();
json['lstAssessments'].forEach((v) {
lstAssessments.add(new LstAssessments.fromJson(v));
});
}
if (json['lstPhysicalExam'] != null) {
lstPhysicalExam = new List<LstPhysicalExam>();
json['lstPhysicalExam'].forEach((v) {
lstPhysicalExam.add(new LstPhysicalExam.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['AdmissionNo'] = this.admissionNo;
data['AppointmentDate'] = this.appointmentDate;
data['AppointmentNo'] = this.appointmentNo;
data['AppointmentType'] = this.appointmentType;
data['ClinicID'] = this.clinicID;
data['ClinicName'] = this.clinicName;
data['DoctorID'] = this.doctorID;
data['DoctorName'] = this.doctorName;
data['EndTime'] = this.endTime;
data['EpisodeDate'] = this.episodeDate;
data['EpisodeID'] = this.episodeID;
data['PatientID'] = this.patientID;
data['ProjectID'] = this.projectID;
data['ProjectName'] = this.projectName;
data['Remarks'] = this.remarks;
data['SetupID'] = this.setupID;
data['StartTime'] = this.startTime;
data['VisitFor'] = this.visitFor;
data['VisitType'] = this.visitType;
data['dispalyName'] = this.dispalyName;
if (this.lstAssessments != null) {
data['lstAssessments'] =
this.lstAssessments.map((v) => v.toJson()).toList();
}
if (this.lstPhysicalExam != null) {
data['lstPhysicalExam'] =
this.lstPhysicalExam.map((v) => v.toJson()).toList();
}
return data;
}
}
class LstAssessments {
int appointmentNo;
String condition;
String description;
int episodeID;
String iCD10;
int patientID;
String patientType;
int projectID;
String projectName;
String remarks;
String setupID;
String type;
String dispalyName;
LstAssessments(
{this.appointmentNo,
this.condition,
this.description,
this.episodeID,
this.iCD10,
this.patientID,
this.patientType,
this.projectID,
this.projectName,
this.remarks,
this.setupID,
this.type,
this.dispalyName});
LstAssessments.fromJson(Map<String, dynamic> json) {
appointmentNo = json['AppointmentNo'];
condition = json['Condition'];
description = json['Description'];
episodeID = json['EpisodeID'];
iCD10 = json['ICD10'];
patientID = json['PatientID'];
patientType = json['PatientType'];
projectID = json['ProjectID'];
projectName = json['ProjectName'];
remarks = json['Remarks'];
setupID = json['SetupID'];
type = json['Type'];
dispalyName = json['dispalyName'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['AppointmentNo'] = this.appointmentNo;
data['Condition'] = this.condition;
data['Description'] = this.description;
data['EpisodeID'] = this.episodeID;
data['ICD10'] = this.iCD10;
data['PatientID'] = this.patientID;
data['PatientType'] = this.patientType;
data['ProjectID'] = this.projectID;
data['ProjectName'] = this.projectName;
data['Remarks'] = this.remarks;
data['SetupID'] = this.setupID;
data['Type'] = this.type;
data['dispalyName'] = this.dispalyName;
return data;
}
}
class LstPhysicalExam {
String abnormal;
int appointmentNo;
int episodeID;
String examDesc;
String examID;
String examType;
int patientID;
String patientType;
int projectID;
String projectName;
String remarks;
String setupID;
String dispalyName;
LstPhysicalExam(
{this.abnormal,
this.appointmentNo,
this.episodeID,
this.examDesc,
this.examID,
this.examType,
this.patientID,
this.patientType,
this.projectID,
this.projectName,
this.remarks,
this.setupID,
this.dispalyName});
LstPhysicalExam.fromJson(Map<String, dynamic> json) {
abnormal = json['Abnormal'];
appointmentNo = json['AppointmentNo'];
episodeID = json['EpisodeID'];
examDesc = json['ExamDesc'];
examID = json['ExamID'];
examType = json['ExamType'];
patientID = json['PatientID'];
patientType = json['PatientType'];
projectID = json['ProjectID'];
projectName = json['ProjectName'];
remarks = json['Remarks'];
setupID = json['SetupID'];
dispalyName = json['dispalyName'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['Abnormal'] = this.abnormal;
data['AppointmentNo'] = this.appointmentNo;
data['EpisodeID'] = this.episodeID;
data['ExamDesc'] = this.examDesc;
data['ExamID'] = this.examID;
data['ExamType'] = this.examType;
data['PatientID'] = this.patientID;
data['PatientType'] = this.patientType;
data['ProjectID'] = this.projectID;
data['ProjectName'] = this.projectName;
data['Remarks'] = this.remarks;
data['SetupID'] = this.setupID;
data['dispalyName'] = this.dispalyName;
return data; return data;
} }
} }

@ -35,316 +35,308 @@ void addPrescriptionForm(context, PrescriptionViewModel model) {
isScrollControlled: true, isScrollControlled: true,
context: context, context: context,
builder: (BuildContext bc) { builder: (BuildContext bc) {
return BaseView<PrescriptionViewModel>( return //BaseView<PrescriptionViewModel>(
onModelReady: (model) => model.getDrugs(), //onModelReady: (model) => model.getDrugs(),
builder: (BuildContext context, PrescriptionViewModel model, //builder: (BuildContext context, PrescriptionViewModel model,
Widget child) => //Widget child) =>
DraggableScrollableSheet( DraggableScrollableSheet(
initialChildSize: 0.90, initialChildSize: 0.90,
maxChildSize: 0.90, maxChildSize: 0.90,
minChildSize: 0.9, minChildSize: 0.9,
builder: (BuildContext context, builder:
ScrollController scrollController) { (BuildContext context, ScrollController scrollController) {
return SingleChildScrollView( return SingleChildScrollView(
child: Container( child: Container(
height: 980, height: 980,
child: Padding( child: Padding(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
horizontal: 12.0, vertical: 10.0), horizontal: 12.0, vertical: 10.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
//mainAxisAlignment: MainAxisAlignment.spaceEvenly, //mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [ children: [
AppText( AppText(
TranslationBase.of(context) TranslationBase.of(context)
.medicines .medicines
.toUpperCase(), .toUpperCase(),
fontWeight: FontWeight.w900, fontWeight: FontWeight.w900,
), ),
SizedBox( SizedBox(
height: spaceBetweenTextFileds, height: spaceBetweenTextFileds,
), ),
Container( Container(
child: Form( child: Form(
key: formKey, key: formKey,
child: Column( child: Column(
//mainAxisAlignment: MainAxisAlignment.end, //mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(6.0)), Radius.circular(6.0)),
border: Border.all( border: Border.all(
width: 1.0, width: 1.0,
color: HexColor("#CCCCCC"))), color: HexColor("#CCCCCC"))),
child: TextFields( child: TextFields(
hintText:
TranslationBase.of(context)
.searchMedicine,
controller: drugIdController,
keyboardType: TextInputType.number,
validator: (value) {
if (value.isEmpty)
return TranslationBase.of(
context)
.emptyMessage;
else
return null;
}),
),
SizedBox(
height: spaceBetweenTextFileds,
),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
child: TextFields(
hintText: TranslationBase.of(context)
.orderType,
),
),
SizedBox(height: spaceBetweenTextFileds),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
child: TextFields(
hintText: TranslationBase.of(context) hintText: TranslationBase.of(context)
.strength, .searchMedicine,
controller: drugIdController,
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
controller: strengthController,
validator: (value) { validator: (value) {
if (value.isEmpty) if (value.isEmpty)
return TranslationBase.of(context) return TranslationBase.of(context)
.emptyMessage; .emptyMessage;
else else
return null; return null;
}, }),
), ),
SizedBox(
height: spaceBetweenTextFileds,
),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
child: TextFields(
hintText: TranslationBase.of(context)
.orderType,
), ),
SizedBox(height: spaceBetweenTextFileds), ),
Container( SizedBox(height: spaceBetweenTextFileds),
decoration: BoxDecoration( Container(
borderRadius: BorderRadius.all( decoration: BoxDecoration(
Radius.circular(6.0)), borderRadius: BorderRadius.all(
border: Border.all( Radius.circular(6.0)),
width: 1.0, border: Border.all(
color: HexColor("#CCCCCC"))), width: 1.0,
child: TextFields( color: HexColor("#CCCCCC"))),
hintText: child: TextFields(
TranslationBase.of(context).route, hintText: TranslationBase.of(context)
controller: routeController, .strength,
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
validator: (value) { controller: strengthController,
if (value.isEmpty) validator: (value) {
return TranslationBase.of(context) if (value.isEmpty)
.emptyMessage; return TranslationBase.of(context)
else .emptyMessage;
return null; else
}, return null;
), },
), ),
SizedBox(height: spaceBetweenTextFileds), ),
Container( SizedBox(height: spaceBetweenTextFileds),
decoration: BoxDecoration( Container(
borderRadius: BorderRadius.all( decoration: BoxDecoration(
Radius.circular(6.0)), borderRadius: BorderRadius.all(
border: Border.all( Radius.circular(6.0)),
width: 1.0, border: Border.all(
color: HexColor("#CCCCCC"))), width: 1.0,
child: TextFields( color: HexColor("#CCCCCC"))),
hintText: TranslationBase.of(context) child: TextFields(
.frequency, hintText:
controller: frequencyController, TranslationBase.of(context).route,
keyboardType: TextInputType.number, controller: routeController,
validator: (value) { keyboardType: TextInputType.number,
if (value.isEmpty) validator: (value) {
return TranslationBase.of(context) if (value.isEmpty)
.emptyMessage; return TranslationBase.of(context)
else .emptyMessage;
return null; else
}, return null;
), },
), ),
SizedBox(height: spaceBetweenTextFileds), ),
Container( SizedBox(height: spaceBetweenTextFileds),
decoration: BoxDecoration( Container(
borderRadius: BorderRadius.all( decoration: BoxDecoration(
Radius.circular(6.0)), borderRadius: BorderRadius.all(
border: Border.all( Radius.circular(6.0)),
width: 1.0, border: Border.all(
color: HexColor("#CCCCCC"))), width: 1.0,
child: TextFields( color: HexColor("#CCCCCC"))),
hintText: TranslationBase.of(context) child: TextFields(
.doseTime, hintText: TranslationBase.of(context)
controller: doseController, .frequency,
keyboardType: TextInputType.number, controller: frequencyController,
validator: (value) { keyboardType: TextInputType.number,
if (value.isEmpty) validator: (value) {
return TranslationBase.of(context) if (value.isEmpty)
.emptyMessage; return TranslationBase.of(context)
else .emptyMessage;
return null; else
}, return null;
), },
), ),
SizedBox(height: spaceBetweenTextFileds), ),
Container( SizedBox(height: spaceBetweenTextFileds),
decoration: BoxDecoration( Container(
borderRadius: BorderRadius.all( decoration: BoxDecoration(
Radius.circular(6.0)), borderRadius: BorderRadius.all(
border: Border.all( Radius.circular(6.0)),
width: 1.0, border: Border.all(
color: HexColor("#CCCCCC"))), width: 1.0,
child: TextFields( color: HexColor("#CCCCCC"))),
hintText: TranslationBase.of(context) child: TextFields(
.indication, hintText: TranslationBase.of(context)
controller: indicationController, .doseTime,
keyboardType: TextInputType.number, controller: doseController,
validator: (value) { keyboardType: TextInputType.number,
if (value.isEmpty) validator: (value) {
return TranslationBase.of(context) if (value.isEmpty)
.emptyMessage; return TranslationBase.of(context)
else .emptyMessage;
return null; else
}, return null;
), },
), ),
SizedBox(height: spaceBetweenTextFileds), ),
Container( SizedBox(height: spaceBetweenTextFileds),
decoration: BoxDecoration( Container(
borderRadius: BorderRadius.all( decoration: BoxDecoration(
Radius.circular(6.0)), borderRadius: BorderRadius.all(
border: Border.all( Radius.circular(6.0)),
width: 1.0, border: Border.all(
color: HexColor("#CCCCCC"))), width: 1.0,
child: TextFields( color: HexColor("#CCCCCC"))),
hintText: TranslationBase.of(context) child: TextFields(
.fromDate, hintText: TranslationBase.of(context)
keyboardType: TextInputType.datetime, .indication,
validator: (value) { controller: indicationController,
if (value.isEmpty) keyboardType: TextInputType.number,
return TranslationBase.of(context) validator: (value) {
.emptyMessage; if (value.isEmpty)
else return TranslationBase.of(context)
return null; .emptyMessage;
}, else
), return null;
},
), ),
SizedBox(height: spaceBetweenTextFileds), ),
Container( SizedBox(height: spaceBetweenTextFileds),
decoration: BoxDecoration( Container(
borderRadius: BorderRadius.all( decoration: BoxDecoration(
Radius.circular(6.0)), borderRadius: BorderRadius.all(
border: Border.all( Radius.circular(6.0)),
width: 1.0, border: Border.all(
color: HexColor("#CCCCCC"))), width: 1.0,
child: TextFields( color: HexColor("#CCCCCC"))),
hintText: child: TextFields(
TranslationBase.of(context) hintText: TranslationBase.of(context)
.duration, .fromDate,
// borderColor: Colors.white, keyboardType: TextInputType.datetime,
keyboardType: TextInputType.number, validator: (value) {
controller: durationController, if (value.isEmpty)
validator: (value) { return TranslationBase.of(context)
if (value.isEmpty) .emptyMessage;
return TranslationBase.of( else
context) return null;
.emptyMessage; },
else
return null;
}),
), ),
SizedBox(height: spaceBetweenTextFileds), ),
Container( SizedBox(height: spaceBetweenTextFileds),
decoration: BoxDecoration( Container(
borderRadius: BorderRadius.all( decoration: BoxDecoration(
Radius.circular(6.0)), borderRadius: BorderRadius.all(
border: Border.all( Radius.circular(6.0)),
width: 1.0, border: Border.all(
color: HexColor("#CCCCCC"))), width: 1.0,
child: TextFields( color: HexColor("#CCCCCC"))),
child: TextFields(
hintText: TranslationBase.of(context) hintText: TranslationBase.of(context)
.instruction, .duration,
controller: indicationController, // borderColor: Colors.white,
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
controller: durationController,
validator: (value) { validator: (value) {
if (value.isEmpty) if (value.isEmpty)
return TranslationBase.of(context) return TranslationBase.of(context)
.emptyMessage; .emptyMessage;
else else
return null; return null;
}, }),
), ),
SizedBox(height: spaceBetweenTextFileds),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
child: TextFields(
hintText: TranslationBase.of(context)
.instruction,
controller: indicationController,
keyboardType: TextInputType.number,
validator: (value) {
if (value.isEmpty)
return TranslationBase.of(context)
.emptyMessage;
else
return null;
},
), ),
SizedBox(height: spaceBetweenTextFileds), ),
Container( SizedBox(height: spaceBetweenTextFileds),
margin: EdgeInsets.all( Container(
SizeConfig.widthMultiplier * 5), margin: EdgeInsets.all(
child: Wrap( SizeConfig.widthMultiplier * 5),
alignment: WrapAlignment.center, child: Wrap(
children: <Widget>[ alignment: WrapAlignment.center,
AppButton( children: <Widget>[
title: TranslationBase.of(context) AppButton(
.addMedication, title: TranslationBase.of(context)
onPressed: () { .addMedication,
formKey.currentState.save(); onPressed: () {
formKey.currentState.save();
if (formKey.currentState if (formKey.currentState
.validate()) { .validate()) {
postProcedure( postProcedure(
model: model, model: model,
duration: duration:
durationController.text, durationController.text,
dose: doseController.text, dose: doseController.text,
frequency: frequency:
frequencyController frequencyController.text,
.text, route: routeController.text,
route: routeController.text, drugId: drugIdController.text,
drugId: strength:
drugIdController.text, strengthController.text,
strength: indication:
strengthController.text, indicationController.text,
indication: instruction:
indicationController indicationController.text,
.text, );
instruction: Navigator.pop(context);
indicationController }
.text, {
); // Navigator.push(
Navigator.pop(context); // context,
} // MaterialPageRoute(
{ // builder: (context) =>
// Navigator.push( // NewPrescriptionScreen()),
// context, // );
// MaterialPageRoute( }
// builder: (context) => },
// NewPrescriptionScreen()), ),
// ); ],
}
},
),
],
),
), ),
], ),
), ],
), ),
), ),
], ),
), ],
), ),
), ),
); ),
}), );
); });
//);
}); });
} }

Loading…
Cancel
Save