diff --git a/lib/core/model/medical_file_model.dart b/lib/core/model/medical_file_model.dart index eb88f0d4..0496d0eb 100644 --- a/lib/core/model/medical_file_model.dart +++ b/lib/core/model/medical_file_model.dart @@ -1,7 +1,7 @@ class MedicalFileModel { List entityList; int rowcount; - dynamic statusMessage; + Null statusMessage; MedicalFileModel({this.entityList, this.rowcount, this.statusMessage}); @@ -190,12 +190,12 @@ class LstDischargeDiag { projectName = json['ProjectName']; remarks = json['Remarks']; setupID = json['SetupID']; - // if (json['TimeLineEvents'] != null) { - // timeLineEvents = new List(); - // json['TimeLineEvents'].forEach((v) { - // timeLineEvents.add(new TimeLineEvents.fromJson(v)); - // }); - // } + if (json['TimeLineEvents'] != null) { + timeLineEvents = new List(); + json['TimeLineEvents'].forEach((v) { + timeLineEvents.add(new TimeLineEvents.fromJson(v)); + }); + } } Map toJson() { @@ -246,49 +246,49 @@ class TimeLineEvents { this.radReports, this.toolTip}); - // TimeLineEvents.fromJson(Map json) { - // if (json['Admissions'] != null) { - // admissions = new List(); - // json['Admissions'].forEach((v) { - // admissions.add(new Null.fromJson(v)); - // }); - // } - // colorClass = json['ColorClass']; - // if (json['Consulations'] != null) { - // consulations = new List(); - // json['Consulations'].forEach((v) { - // consulations.add(new Null.fromJson(v)); - // }); - // } - // disPlayName = json['DisPlayName']; - // doctorName = json['DoctorName']; - // eRData = - // json['ERData'] != null ? new ERData.fromJson(json['ERData']) : null; - // eventId = json['EventId']; - // fullName = json['FullName']; - // iconClass = json['IconClass']; - // isDisabled = json['IsDisabled']; - // if (json['LabOrders'] != null) { - // labOrders = new List(); - // json['LabOrders'].forEach((v) { - // labOrders.add(new Null.fromJson(v)); - // }); - // } - // if (json['RadReports'] != null) { - // radReports = new List(); - // json['RadReports'].forEach((v) { - // radReports.add(new Null.fromJson(v)); - // }); - // } - // toolTip = json['ToolTip']; - // } + TimeLineEvents.fromJson(Map json) { + // if (json['Admissions'] != null) { + // admissions = new List(); + // json['Admissions'].forEach((v) { + // admissions.add(new Null.fromJson(v)); + // }); + // } + // colorClass = json['ColorClass']; + // if (json['Consulations'] != null) { + // consulations = new List(); + // json['Consulations'].forEach((v) { + // consulations.add(new Null.fromJson(v)); + // }); + // } + disPlayName = json['DisPlayName']; + doctorName = json['DoctorName']; + eRData = + json['ERData'] != null ? new ERData.fromJson(json['ERData']) : null; + eventId = json['EventId']; + fullName = json['FullName']; + iconClass = json['IconClass']; + isDisabled = json['IsDisabled']; + // if (json['LabOrders'] != null) { + // labOrders = new List(); + // json['LabOrders'].forEach((v) { + // labOrders.add(new Null.fromJson(v)); + // }); + // } + // if (json['RadReports'] != null) { + // radReports = new List(); + // json['RadReports'].forEach((v) { + // radReports.add(new Null.fromJson(v)); + // }); + // } + toolTip = json['ToolTip']; + } Map toJson() { final Map data = new Map(); // if (this.admissions != null) { // data['Admissions'] = this.admissions.map((v) => v.toJson()).toList(); // } - data['ColorClass'] = this.colorClass; + // data['ColorClass'] = this.colorClass; // if (this.consulations != null) { // data['Consulations'] = this.consulations.map((v) => v.toJson()).toList(); // } @@ -326,38 +326,38 @@ class ERData { this.radReports, this.lstErDischargeSummary}); - // ERData.fromJson(Map json) { - // if (json['Admissions'] != null) { - // admissions = new List(); - // json['Admissions'].forEach((v) { - // admissions.add(new Null.fromJson(v)); - // }); - // } - // if (json['Consulations'] != null) { - // consulations = new List(); - // json['Consulations'].forEach((v) { - // consulations.add(new Null.fromJson(v)); - // }); - // } - // if (json['LabOrders'] != null) { - // labOrders = new List(); - // json['LabOrders'].forEach((v) { - // labOrders.add(new Null.fromJson(v)); - // }); - // } - // if (json['RadReports'] != null) { - // radReports = new List(); - // json['RadReports'].forEach((v) { - // radReports.add(new Null.fromJson(v)); - // }); - // } - // if (json['lstErDischargeSummary'] != null) { - // lstErDischargeSummary = new List(); - // json['lstErDischargeSummary'].forEach((v) { - // lstErDischargeSummary.add(new Null.fromJson(v)); - // }); - // } - // } + ERData.fromJson(Map json) { + // if (json['Admissions'] != null) { + // admissions = new List(); + // json['Admissions'].forEach((v) { + // admissions.add(new Null.fromJson(v)); + // }); + // } + // if (json['Consulations'] != null) { + // consulations = new List(); + // json['Consulations'].forEach((v) { + // consulations.add(new Null.fromJson(v)); + // }); + // } + // if (json['LabOrders'] != null) { + // labOrders = new List(); + // json['LabOrders'].forEach((v) { + // labOrders.add(new Null.fromJson(v)); + // }); + // } + // if (json['RadReports'] != null) { + // radReports = new List(); + // json['RadReports'].forEach((v) { + // radReports.add(new Null.fromJson(v)); + // }); + // } + // if (json['lstErDischargeSummary'] != null) { + // lstErDischargeSummary = new List(); + // json['lstErDischargeSummary'].forEach((v) { + // lstErDischargeSummary.add(new Null.fromJson(v)); + // }); + // } + } Map toJson() { final Map data = new Map(); @@ -827,6 +827,7 @@ class DoctorWisePatientEpisodes { String setupID; int doctorID; String doctorName; + List lstEpisodes; DoctorWisePatientEpisodes( {this.clinicName, @@ -835,7 +836,8 @@ class DoctorWisePatientEpisodes { this.projectName, this.setupID, this.doctorID, - this.doctorName}); + this.doctorName, + this.lstEpisodes}); DoctorWisePatientEpisodes.fromJson(Map json) { clinicName = json['ClinicName']; @@ -845,6 +847,12 @@ class DoctorWisePatientEpisodes { setupID = json['SetupID']; doctorID = json['doctorID']; doctorName = json['doctorName']; + if (json['lstEpisodes'] != null) { + lstEpisodes = new List(); + json['lstEpisodes'].forEach((v) { + lstEpisodes.add(new LstEpisodes.fromJson(v)); + }); + } } Map toJson() { @@ -856,6 +864,256 @@ class DoctorWisePatientEpisodes { data['SetupID'] = this.setupID; data['doctorID'] = this.doctorID; 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; + List 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 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(); + json['lstAssessments'].forEach((v) { + lstAssessments.add(new LstAssessments.fromJson(v)); + }); + } + if (json['lstPhysicalExam'] != null) { + lstPhysicalExam = new List(); + json['lstPhysicalExam'].forEach((v) { + lstPhysicalExam.add(new LstPhysicalExam.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + 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 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 toJson() { + final Map data = new Map(); + 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 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 toJson() { + final Map data = new Map(); + 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; } } diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index e3ed71a9..6d1d7cf3 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -35,316 +35,308 @@ void addPrescriptionForm(context, PrescriptionViewModel model) { isScrollControlled: true, context: context, builder: (BuildContext bc) { - return BaseView( - onModelReady: (model) => model.getDrugs(), - builder: (BuildContext context, PrescriptionViewModel model, - Widget child) => - DraggableScrollableSheet( - initialChildSize: 0.90, - maxChildSize: 0.90, - minChildSize: 0.9, - builder: (BuildContext context, - ScrollController scrollController) { - return SingleChildScrollView( - child: Container( - height: 980, - child: Padding( - padding: EdgeInsets.symmetric( - horizontal: 12.0, vertical: 10.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - //mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - AppText( - TranslationBase.of(context) - .medicines - .toUpperCase(), - fontWeight: FontWeight.w900, - ), - SizedBox( - height: spaceBetweenTextFileds, - ), - Container( - child: Form( - key: formKey, - child: Column( - //mainAxisAlignment: MainAxisAlignment.end, - children: [ - 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) - .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( + return //BaseView( + //onModelReady: (model) => model.getDrugs(), + //builder: (BuildContext context, PrescriptionViewModel model, + //Widget child) => + DraggableScrollableSheet( + initialChildSize: 0.90, + maxChildSize: 0.90, + minChildSize: 0.9, + builder: + (BuildContext context, ScrollController scrollController) { + return SingleChildScrollView( + child: Container( + height: 980, + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 12.0, vertical: 10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + //mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + AppText( + TranslationBase.of(context) + .medicines + .toUpperCase(), + fontWeight: FontWeight.w900, + ), + SizedBox( + height: spaceBetweenTextFileds, + ), + Container( + child: Form( + key: formKey, + child: Column( + //mainAxisAlignment: MainAxisAlignment.end, + children: [ + 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) - .strength, + .searchMedicine, + controller: drugIdController, keyboardType: TextInputType.number, - controller: strengthController, 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).route, - controller: routeController, - 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) + .strength, + keyboardType: TextInputType.number, + controller: strengthController, + 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) - .frequency, - controller: frequencyController, - 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).route, + controller: routeController, + 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) - .doseTime, - controller: doseController, - 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) + .frequency, + controller: frequencyController, + 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) - .indication, - controller: indicationController, - 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) + .doseTime, + controller: doseController, + 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) - .fromDate, - keyboardType: TextInputType.datetime, - 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) + .indication, + controller: indicationController, + 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) - .duration, - // borderColor: Colors.white, - keyboardType: TextInputType.number, - controller: durationController, - 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) + .fromDate, + keyboardType: TextInputType.datetime, + 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( + ), + 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, + .duration, + // borderColor: Colors.white, keyboardType: TextInputType.number, + controller: durationController, 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) + .instruction, + controller: indicationController, + keyboardType: TextInputType.number, + validator: (value) { + if (value.isEmpty) + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }, ), - SizedBox(height: spaceBetweenTextFileds), - Container( - margin: EdgeInsets.all( - SizeConfig.widthMultiplier * 5), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: TranslationBase.of(context) - .addMedication, - onPressed: () { - formKey.currentState.save(); + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + margin: EdgeInsets.all( + SizeConfig.widthMultiplier * 5), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: TranslationBase.of(context) + .addMedication, + onPressed: () { + formKey.currentState.save(); - if (formKey.currentState - .validate()) { - postProcedure( - model: model, - duration: - durationController.text, - dose: doseController.text, - frequency: - frequencyController - .text, - route: routeController.text, - drugId: - drugIdController.text, - strength: - strengthController.text, - indication: - indicationController - .text, - instruction: - indicationController - .text, - ); - Navigator.pop(context); - } - { - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (context) => - // NewPrescriptionScreen()), - // ); - } - }, - ), - ], - ), + if (formKey.currentState + .validate()) { + postProcedure( + model: model, + duration: + durationController.text, + dose: doseController.text, + frequency: + frequencyController.text, + route: routeController.text, + drugId: drugIdController.text, + strength: + strengthController.text, + indication: + indicationController.text, + instruction: + indicationController.text, + ); + Navigator.pop(context); + } + { + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (context) => + // NewPrescriptionScreen()), + // ); + } + }, + ), + ], ), - ], - ), + ), + ], ), ), - ], - ), + ), + ], ), ), - ); - }), - ); + ), + ); + }); + //); }); }