merge-requests/456/head
Sultan Khan 5 years ago
commit c60e0dc54b

@ -62,7 +62,7 @@ class ProcedureViewModel extends BaseViewModel {
await _procedureService.getProcedure(mrn: mrn); await _procedureService.getProcedure(mrn: mrn);
if (_procedureService.hasError) { if (_procedureService.hasError) {
error = _procedureService.error; error = _procedureService.error;
setState(ViewState.ErrorLocal); setState(ViewState.Error);
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
} }

@ -2358,4 +2358,3 @@
} }
] ]
} }
}

@ -5,6 +5,7 @@ class MySelectedAllergy {
MasterKeyModel selectedAllergy; MasterKeyModel selectedAllergy;
String remark; String remark;
bool isChecked; bool isChecked;
bool isExpanded;
int createdBy; int createdBy;
MySelectedAllergy( MySelectedAllergy(
@ -12,6 +13,7 @@ class MySelectedAllergy {
this.selectedAllergy, this.selectedAllergy,
this.remark, this.remark,
this.isChecked, this.isChecked,
this.isExpanded = true,
this.createdBy}); this.createdBy});
MySelectedAllergy.fromJson(Map<String, dynamic> json) { MySelectedAllergy.fromJson(Map<String, dynamic> json) {
@ -22,7 +24,8 @@ class MySelectedAllergy {
? new MasterKeyModel.fromJson(json['selectedAllergy']) ? new MasterKeyModel.fromJson(json['selectedAllergy'])
: null; : null;
remark = json['remark']; remark = json['remark'];
remark = json['isChecked']; isChecked = json['isChecked'];
isExpanded = json['isExpanded'];
createdBy = json['createdBy']; createdBy = json['createdBy'];
} }
@ -35,7 +38,8 @@ class MySelectedAllergy {
data['selectedAllergy'] = this.selectedAllergy.toJson(); data['selectedAllergy'] = this.selectedAllergy.toJson();
} }
data['remark'] = this.remark; data['remark'] = this.remark;
data['isChecked'] = this.remark; data['isChecked'] = this.isChecked;
data['isExpanded'] = this.isExpanded;
data['createdBy'] = this.createdBy; data['createdBy'] = this.createdBy;
return data; return data;
} }

@ -468,10 +468,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
Row( Row(
children: [ children: [
AppText( AppText(
'ICD', 'ICD: ',
fontWeight: fontSize: 13.0,
FontWeight
.w700,
), ),
AppText( AppText(
model model
@ -488,14 +486,20 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
index] index]
.iCD10 .iCD10
.trim(), .trim(),
fontSize: 13.5,
fontWeight:
FontWeight
.w700,
), ),
SizedBox( SizedBox(
width: 35.0), width: 15.0),
],
),
Row(
children: [
AppText( AppText(
'Condition: ', 'Condition: ',
fontWeight: fontSize: 12.5,
FontWeight
.w700,
), ),
Expanded( Expanded(
child: AppText( child: AppText(
@ -514,6 +518,10 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
index] index]
.condition .condition
.trim(), .trim(),
fontSize: 13.0,
fontWeight:
FontWeight
.w700,
), ),
), ),
], ],
@ -539,6 +547,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
fontWeight: fontWeight:
FontWeight FontWeight
.w700, .w700,
fontSize: 15.0,
), ),
) )
], ],
@ -547,15 +556,15 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
children: [ children: [
AppText( AppText(
'Type: ', 'Type: ',
fontWeight: fontSize: 15.5,
FontWeight
.w700,
), ),
Expanded( Expanded(
child: AppText(model child: AppText(
model
.medicalFileList[ .medicalFileList[
0] 0]
.entityList[0] .entityList[
0]
.timelines[ .timelines[
encounterNumber] encounterNumber]
.timeLineEvents[ .timeLineEvents[
@ -564,7 +573,12 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
0] 0]
.lstAssessments[ .lstAssessments[
index] index]
.type), .type,
fontSize: 16.0,
fontWeight:
FontWeight
.w700,
),
), ),
], ],
), ),
@ -700,9 +714,6 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
children: [ children: [
AppText( AppText(
'Procedure ID: ', 'Procedure ID: ',
fontWeight:
FontWeight
.w700,
), ),
AppText( AppText(
model model
@ -720,6 +731,11 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
index] index]
.procedureId .procedureId
.trim(), .trim(),
fontSize:
13.5,
fontWeight:
FontWeight
.w700,
), ),
], ],
), ),
@ -729,9 +745,6 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
children: [ children: [
AppText( AppText(
'Order Date: ', 'Order Date: ',
fontWeight:
FontWeight
.w700,
), ),
AppText( AppText(
Helpers.getDateFormatted( Helpers.getDateFormatted(
@ -755,6 +768,9 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
)), )),
fontSize: fontSize:
13.5, 13.5,
fontWeight:
FontWeight
.w700,
), ),
], ],
), ),
@ -792,11 +808,9 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
children: [ children: [
AppText( AppText(
'CPT Code : ', 'CPT Code : ',
fontWeight:
FontWeight
.w700,
), ),
AppText(model AppText(
model
.medicalFileList[ .medicalFileList[
0] 0]
.entityList[0] .entityList[0]
@ -804,11 +818,16 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
encounterNumber] encounterNumber]
.timeLineEvents[ .timeLineEvents[
0] 0]
.consulations[0] .consulations[
0]
.lstProcedure[ .lstProcedure[
index] index]
.patientID .patientID
.toString()), .toString(),
fontWeight:
FontWeight
.w700,
),
], ],
), ),
SizedBox( SizedBox(
@ -924,11 +943,9 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
children: [ children: [
AppText( AppText(
'Exam Type: ', 'Exam Type: ',
fontWeight:
FontWeight
.w700,
), ),
AppText(model AppText(
model
.medicalFileList[ .medicalFileList[
0] 0]
.entityList[0] .entityList[0]
@ -936,10 +953,15 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
encounterNumber] encounterNumber]
.timeLineEvents[ .timeLineEvents[
0] 0]
.consulations[0] .consulations[
0]
.lstPhysicalExam[ .lstPhysicalExam[
index] index]
.examDesc), .examDesc,
fontWeight:
FontWeight
.w700,
),
], ],
), ),
Row( Row(
@ -968,11 +990,9 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
children: [ children: [
AppText( AppText(
'Abnormal: ', 'Abnormal: ',
fontWeight:
FontWeight
.w700,
), ),
AppText(model AppText(
model
.medicalFileList[ .medicalFileList[
0] 0]
.entityList[0] .entityList[0]
@ -980,10 +1000,15 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
encounterNumber] encounterNumber]
.timeLineEvents[ .timeLineEvents[
0] 0]
.consulations[0] .consulations[
0]
.lstPhysicalExam[ .lstPhysicalExam[
index] index]
.abnormal), .abnormal,
fontWeight:
FontWeight
.w700,
),
], ],
), ),
SizedBox( SizedBox(

@ -40,7 +40,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
(BuildContext context, MedicalFileViewModel model, Widget child) => (BuildContext context, MedicalFileViewModel model, Widget child) =>
AppScaffold( AppScaffold(
appBar: PatientProfileHeaderNewDesignAppBar( appBar: PatientProfileHeaderNewDesignAppBar(
patient, patientType.toString() ?? "0", patientType), patient, patientType.toString() ?? "0", arrivalType),
isShowAppBar: true, isShowAppBar: true,
appBarTitle: TranslationBase.of(context).medicalReport.toUpperCase(), appBarTitle: TranslationBase.of(context).medicalReport.toUpperCase(),
body: NetworkBaseView( body: NetworkBaseView(

@ -9,6 +9,7 @@ import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_head
import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/app_button.dart'; import 'package:doctor_app_flutter/widgets/shared/app_button.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -80,27 +81,27 @@ class RadiologyDetailsPage extends StatelessWidget {
SizedBox( SizedBox(
height: 100, height: 100,
), ),
], ],
), ),
), ),
], ],
), ),
), ),
bottomSheet: model.radImageURL.isNotEmpty ?Container( bottomSheet: model.radImageURL.isNotEmpty
? Container(
width: double.maxFinite, width: double.maxFinite,
height: 100,
child: Container( child: Container(
margin: EdgeInsets.only(left: 35,right: 35,top: 12,bottom: 12), margin:
child: Button( EdgeInsets.only(left: 35, right: 35, top: 12, bottom: 12),
color: Colors.red, child: AppButton(
onTap: () { onPressed: () {
launch(model.radImageURL); launch(model.radImageURL);
}, },
title: TranslationBase.of(context).openRad, title: TranslationBase.of(context).openRad,
), ),
), ),
):null, )
: null,
), ),
); );
} }

@ -17,6 +17,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/borderedButton.dart'; import 'package:doctor_app_flutter/widgets/shared/borderedButton.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';

@ -8,6 +8,7 @@ import 'package:doctor_app_flutter/widgets/patients/profile/profile-welcome-widg
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../../../routes.dart'; import '../../../../routes.dart';
@ -74,11 +75,8 @@ class MyReferralPatientScreen extends StatelessWidget {
'referral': model.pendingReferral[index] 'referral': model.pendingReferral[index]
}); });
}, },
child: Icon( child: Icon(FontAwesomeIcons.arrowRight,
Icons.info_outline, size: 25, color: Colors.black),
color: Colors.black,
size: 30,
),
), ),
), ),
), ),

@ -33,7 +33,7 @@ class PrescriptionsPage extends StatelessWidget {
baseViewModel: model, baseViewModel: model,
isShowAppBar: true, isShowAppBar: true,
appBar: PatientProfileHeaderNewDesignAppBar( appBar: PatientProfileHeaderNewDesignAppBar(
patient, arrivalType ?? '0', patientType), patient, patientType ?? '0', arrivalType),
body: FractionallySizedBox( body: FractionallySizedBox(
widthFactor: 1.0, widthFactor: 1.0,
child: ListView( child: ListView(

@ -10,8 +10,16 @@ import 'package:provider/provider.dart';
class ProcedureCard extends StatelessWidget { class ProcedureCard extends StatelessWidget {
final Function onTap; final Function onTap;
final EntityList entityList; final EntityList entityList;
final String categoryName;
final int categoryID;
const ProcedureCard({Key key, this.onTap, this.entityList}) : super(key: key); const ProcedureCard(
{Key key,
this.onTap,
this.entityList,
this.categoryID,
this.categoryName})
: super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -37,9 +45,8 @@ class ProcedureCard extends StatelessWidget {
topLeft: Radius.circular(10), topLeft: Radius.circular(10),
bottomLeft: Radius.circular(10), bottomLeft: Radius.circular(10),
), ),
color: entityList.orderType == 1 color:
? Colors.red[500] entityList.orderType == 1 ? Colors.red[500] : Colors.black,
: Colors.black,
), ),
), ),
Expanded( Expanded(
@ -105,12 +112,43 @@ class ProcedureCard extends StatelessWidget {
children: [ children: [
Texts( Texts(
TranslationBase.of(context).orderNo, TranslationBase.of(context).orderNo,
color: Colors.grey, //color: Colors.grey,
fontSize: 12, fontSize: 12,
color: Colors.grey,
), ),
Texts( Texts(
entityList.orderNo.toString(), entityList.orderNo.toString(),
fontSize: 12,
bold: true,
),
],
),
Row(
children: [
Texts(
TranslationBase.of(context).doctorName + ": ",
//color: Colors.grey,
fontSize: 12,
color: Colors.grey, color: Colors.grey,
),
Texts(
entityList.doctorName.toString(),
fontSize: 12,
bold: true,
),
],
),
Row(
children: [
Texts(
TranslationBase.of(context).clinic + ": ",
//color: Colors.grey,
fontSize: 12,
color: Colors.grey,
),
Texts(
entityList.clinicDescription.toString(),
bold: true,
fontSize: 12, fontSize: 12,
), ),
], ],
@ -119,15 +157,20 @@ class ProcedureCard extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Texts( Texts(
entityList.remarks ?? '', entityList.remarks.toString() ?? '',
fontSize: 12, fontSize: 12,
), ),
Icon(Icons.edit) if (entityList.categoryID == 2 ||
entityList.categoryID == 4)
InkWell(
child: Icon(Icons.edit),
onTap: onTap,
)
], ],
) )
], ],
), ),
onTap: onTap, //onTap: onTap,
), ),
), ),
), ),

@ -29,7 +29,8 @@ class ProcedureScreen extends StatelessWidget {
builder: (BuildContext context, ProcedureViewModel model, Widget child) => builder: (BuildContext context, ProcedureViewModel model, Widget child) =>
AppScaffold( AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBar: PatientProfileHeaderNewDesignAppBar(patient, arrivalType ?? '0', patientType), appBar: PatientProfileHeaderNewDesignAppBar(
patient, arrivalType ?? '0', patientType),
body: NetworkBaseView( body: NetworkBaseView(
baseViewModel: model, baseViewModel: model,
child: SingleChildScrollView( child: SingleChildScrollView(
@ -110,14 +111,13 @@ class ProcedureScreen extends StatelessWidget {
...List.generate( ...List.generate(
model.procedureList[0].rowcount, model.procedureList[0].rowcount,
(index) => ProcedureCard( (index) => ProcedureCard(
categoryID:
model.procedureList[0].entityList[index].categoryID,
entityList: model.procedureList[0].entityList[index], entityList: model.procedureList[0].entityList[index],
onTap: () { onTap: () {
if (model.procedureList[0].entityList[index] if (model.procedureList[0].entityList[index].categoryID ==
.categoryID ==
2 || 2 ||
model.procedureList[0].entityList[index] model.procedureList[0].entityList[index].categoryID == 4)
.categoryID ==
4) {
updateProcedureForm(context, updateProcedureForm(context,
model: model, model: model,
patient: patient, patient: patient,
@ -137,9 +137,9 @@ class ProcedureScreen extends StatelessWidget {
.entityList[index].procedureId, .entityList[index].procedureId,
limetNo: model.procedureList[0] limetNo: model.procedureList[0]
.entityList[index].lineItemNo); .entityList[index].lineItemNo);
} else // } else
helpers.showErrorToast( // helpers.showErrorToast(
'You Cant Update This Procedure'); // 'You Cant Update This Procedure');
}, },
), ),
), ),

@ -463,28 +463,32 @@ class PatientReferralItemWidget extends StatelessWidget {
width: 30, width: 30,
height: 30, height: 30,
margin: EdgeInsets.only( margin: EdgeInsets.only(
left: projectViewModel.isArabic ? 10 : 10 /*10:85*/, left:
right: projectViewModel.isArabic ? 10 : 10 /*85:10*/, projectViewModel.isArabic ? 10 : 10 /*10:85*/,
right:
projectViewModel.isArabic ? 10 : 10 /*85:10*/,
top: 5), top: 5),
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
border: Border( border: Border(
bottom: bottom: BorderSide(
BorderSide(color: Colors.grey[400], width: 2.5), color: Colors.grey[400], width: 2.5),
left: left: BorderSide(
BorderSide(color: Colors.grey[400], width: 2.5), color: Colors.grey[400], width: 2.5),
)), )),
), ),
Expanded( Expanded(
flex: 4, flex: 4,
child: Container( child: Container(
margin: EdgeInsets.only(left: 10, top: 25, right : 10, bottom: 0), margin: EdgeInsets.only(
left: 10, top: 25, right: 10, bottom: 0),
child: Column( child: Column(
children: [ children: [
RichText( RichText(
text: TextSpan( text: TextSpan(
style: TextStyle( style: TextStyle(
fontSize: 2.0 * SizeConfig.textMultiplier, fontSize:
2.0 * SizeConfig.textMultiplier,
color: Colors.black), color: Colors.black),
children: <TextSpan>[ children: <TextSpan>[
TextSpan( TextSpan(
@ -492,7 +496,8 @@ class PatientReferralItemWidget extends StatelessWidget {
.referralDoctor + .referralDoctor +
" : ", " : ",
style: TextStyle( style: TextStyle(
fontSize: 14, fontFamily: 'Poppins')), fontSize: 14,
fontFamily: 'Poppins')),
TextSpan( TextSpan(
text: referralDoctorName, text: referralDoctorName,
style: TextStyle( style: TextStyle(
@ -511,8 +516,7 @@ class PatientReferralItemWidget extends StatelessWidget {
Container( Container(
width: double.infinity, width: double.infinity,
alignment: Alignment.centerRight, alignment: Alignment.centerRight,
child: Icon(FontAwesomeIcons.arrowRight, child: infoIcon ?? Container())
size: 25, color: Colors.black))
], ],
), ),
// onTap: onTap, // onTap: onTap,

@ -116,7 +116,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 12, fontSize: 12,
), ),
arrivalType == '1' arrivalType == '1'|| patient.arrivedOn == null
? AppText( ? AppText(
patient.startTime != null patient.startTime != null
? patient.startTime ? patient.startTime

@ -14,9 +14,10 @@ class PatientProfileHeaderNewDesign extends StatelessWidget {
final PatiantInformtion patient; final PatiantInformtion patient;
final String patientType; final String patientType;
final String arrivalType; final String arrivalType;
final double height;
PatientProfileHeaderNewDesign( PatientProfileHeaderNewDesign(
this.patient, this.patientType, this.arrivalType); this.patient, this.patientType, this.arrivalType, {this.height = 0.0});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -36,7 +37,7 @@ class PatientProfileHeaderNewDesign extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
), ),
height: 200, height: height == 0 ? 200 : height,
child: Container( child: Container(
padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), padding: EdgeInsets.only(left: 10, right: 10, bottom: 10),
margin: EdgeInsets.only(top: 50), margin: EdgeInsets.only(top: 50),
@ -116,7 +117,7 @@ class PatientProfileHeaderNewDesign extends StatelessWidget {
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 12, fontSize: 12,
), ),
arrivalType == '1' arrivalType == '1' || patient.arrivedOn == null
? AppText( ? AppText(
patient.startTime != null patient.startTime != null
? patient.startTime ? patient.startTime

@ -150,7 +150,7 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget {
'Poppins', 'Poppins',
fontSize: 12, fontSize: 12,
), ),
arrivalType == '1' arrivalType == '1' || patient.arrivedOn == null
? AppText( ? AppText(
patient.startTime != patient.startTime !=
null null

@ -150,7 +150,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget with Pre
'Poppins', 'Poppins',
fontSize: 12, fontSize: 12,
), ),
arrivalType == '1' arrivalType == '1' || patient.arrivedOn == null
? AppText( ? AppText(
patient.startTime != patient.startTime !=
null null

@ -43,34 +43,6 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
childAspectRatio: 1 / 1.0, childAspectRatio: 1 / 1.0,
crossAxisCount: 3, crossAxisCount: 3,
children: [ children: [
/*if (int.parse(patientType) == 7 || int.parse(patientType) == 6)
PatientProfileButton(
key: key,
patient: patient,
isDisable: patient.episodeNo != 0 ? true : false,
nameLine1: TranslationBase.of(context).createNew,
nameLine2: TranslationBase.of(context).episode,
route: CREATE_EPISODE,
onTap: () async {
PostEpisodeReqModel postEpisodeReqModel = PostEpisodeReqModel(
appointmentNo: patient.appointmentNo,
patientMRN: patient.patientMRN);
await model.postEpisode(postEpisodeReqModel);
patient.episodeNo = model.episodeID;
Navigator.of(context).pushNamed(CREATE_EPISODE,
arguments: {'patient': patient});
},
isLoading: model.state == ViewState.BusyLocal,
icon: 'create-episod.png'),
if (int.parse(patientType) == 7 || int.parse(patientType) == 6)
PatientProfileButton(
key: key,
patient: patient,
isDisable: patient.episodeNo == 0 ? true : false,
nameLine1: TranslationBase.of(context).update,
nameLine2: TranslationBase.of(context).episode,
route: UPDATE_EPISODE,
icon: 'modilfy-episode.png'),*/
if (int.parse(patientType) == 7 || int.parse(patientType) == 6) if (int.parse(patientType) == 7 || int.parse(patientType) == 6)
PatientProfileButton( PatientProfileButton(
key: key, key: key,
@ -84,15 +56,6 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
route: VITAL_SIGN_DETAILS, route: VITAL_SIGN_DETAILS,
icon: 'patient/vital_signs.png'), icon: 'patient/vital_signs.png'),
if (selectedPatientType != 7) if (selectedPatientType != 7)
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: LAB_RESULT,
nameLine1: TranslationBase.of(context).lab,
nameLine2: TranslationBase.of(context).result,
icon: 'patient/lab_results.png'),
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
@ -102,47 +65,34 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
nameLine1: TranslationBase.of(context).previewHealth, nameLine1: TranslationBase.of(context).previewHealth,
nameLine2: TranslationBase.of(context).summaryReport, nameLine2: TranslationBase.of(context).summaryReport,
icon: 'patient/health_summary.png'), icon: 'patient/health_summary.png'),
if (selectedPatientType != 0 &&
selectedPatientType != 5 &&
selectedPatientType != 7)
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
route: PROGRESS_NOTE, route: LAB_RESULT,
nameLine1: TranslationBase.of(context).progress, nameLine1: TranslationBase.of(context).lab,
nameLine2: TranslationBase.of(context).note, nameLine2: TranslationBase.of(context).result,
icon: 'patient/Progress_notes.png'), icon: 'patient/lab_results.png'),
if (int.parse(patientType) == 7 || int.parse(patientType) == 6) if (int.parse(patientType) == 7 || int.parse(patientType) == 6)
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
route: PATIENT_ADMISSION_REQUEST, route: RADIOLOGY_PATIENT,
nameLine1: TranslationBase.of(context).admission, nameLine1: TranslationBase.of(context).radiology,
nameLine2: TranslationBase.of(context).request, nameLine2: TranslationBase.of(context).service,
icon: 'patient/admission_req.png'), icon: 'patient/health_summary.png'),
// (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton(
// ? PatientProfileButton( key: key,
// key: key, patient: patient,
// patient: patient, patientType: patientType,
// patientType: patientType, arrivalType: arrivalType,
// arrivalType: arrivalType, route: PATIENT_ECG,
// route: ORDER_PRESCRIPTION, nameLine1: TranslationBase.of(context).patient,
// nameLine1: TranslationBase.of(context).orders, nameLine2: "ECG",
// nameLine2: TranslationBase.of(context).prescription, icon: 'patient/patient_sick_leave.png'),
// icon: 'patient/order_prescription.png')
// : PatientProfileButton(
// key: key,
// patient: patient,
// patientType: patientType,
// arrivalType: arrivalType,
// route: ORDER_PRESCRIPTION_HISTORY,
// nameLine1: TranslationBase.of(context).orders,
// nameLine2: TranslationBase.of(context).prescription,
// icon: 'patient/order_prescription.png'),
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
@ -168,10 +118,10 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
route: REFER_PATIENT_TO_DOCTOR, route: PATIENT_INSURANCE_APPROVALS_NEW,
nameLine1: TranslationBase.of(context).myReferral, nameLine1: TranslationBase.of(context).insurance,
nameLine2: TranslationBase.of(context).patient, nameLine2: TranslationBase.of(context).service,
icon: 'patient/refer_patient.png'), icon: 'patient/vital_signs.png'),
if (int.parse(patientType) == 7 || int.parse(patientType) == 6) if (int.parse(patientType) == 7 || int.parse(patientType) == 6)
PatientProfileButton( PatientProfileButton(
key: key, key: key,
@ -189,6 +139,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
route: PATIENT_UCAF_REQUEST, route: PATIENT_UCAF_REQUEST,
isDisable: patient.patientStatusType != 43 ? true : false,
nameLine1: TranslationBase.of(context).patient, nameLine1: TranslationBase.of(context).patient,
nameLine2: TranslationBase.of(context).ucaf, nameLine2: TranslationBase.of(context).ucaf,
icon: 'patient/ucaf.png'), icon: 'patient/ucaf.png'),
@ -198,29 +149,32 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
route: RADIOLOGY_PATIENT, route: REFER_PATIENT_TO_DOCTOR,
nameLine1: TranslationBase.of(context).radiology, isDisable: patient.patientStatusType != 43 ? true : false,
nameLine2: TranslationBase.of(context).service, nameLine1: TranslationBase.of(context).myReferral,
icon: 'patient/health_summary.png'), nameLine2: TranslationBase.of(context).patient,
icon: 'patient/refer_patient.png'),
if (int.parse(patientType) == 7 || int.parse(patientType) == 6) if (int.parse(patientType) == 7 || int.parse(patientType) == 6)
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
route: PATIENT_INSURANCE_APPROVALS_NEW, route: PATIENT_ADMISSION_REQUEST,
nameLine1: TranslationBase.of(context).insurance, isDisable: patient.patientStatusType != 43 ? true : false,
nameLine2: TranslationBase.of(context).service, nameLine1: TranslationBase.of(context).admission,
icon: 'patient/vital_signs.png'), nameLine2: TranslationBase.of(context).request,
icon: 'patient/admission_req.png'),
if (patientType == "1")
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
route: PATIENT_ECG, route: PROGRESS_NOTE,
nameLine1: TranslationBase.of(context).patient, nameLine1: TranslationBase.of(context).progress,
nameLine2: "ECG", nameLine2: TranslationBase.of(context).note,
icon: 'patient/patient_sick_leave.png'), icon: 'patient/Progress_notes.png'),
], ],
), ),
); );

@ -39,19 +39,21 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget {
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
route: RADIOLOGY_PATIENT, from: from,
nameLine1: TranslationBase.of(context).radiology, to: to,
nameLine2: TranslationBase.of(context).service, nameLine1: TranslationBase.of(context).vital,
icon: 'patient/health_summary.png'), nameLine2: TranslationBase.of(context).signs,
route: VITAL_SIGN_DETAILS,
icon: 'patient/vital_signs.png'),
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
route: PATIENT_INSURANCE_APPROVALS_NEW, route: MEDICAL_FILE,
nameLine1: TranslationBase.of(context).insurance, nameLine1: TranslationBase.of(context).previewHealth,
nameLine2: TranslationBase.of(context).service, nameLine2: TranslationBase.of(context).summaryReport,
icon: 'patient/vital_signs.png'), icon: 'patient/health_summary.png'),
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
@ -66,19 +68,19 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget {
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
from: from, route: RADIOLOGY_PATIENT,
to: to, nameLine1: TranslationBase.of(context).radiology,
nameLine1: TranslationBase.of(context).vital, nameLine2: TranslationBase.of(context).service,
nameLine2: TranslationBase.of(context).signs, icon: 'patient/health_summary.png'),
route: VITAL_SIGN_DETAILS, PatientProfileButton(
icon: 'patient/vital_signs.png'), key: key,
// PatientProfileButton( patient: patient,
// key: key, patientType: patientType,
// patient: patient, arrivalType: arrivalType,
// route: PATIENT_ADMISSION_REQUEST, route: PATIENT_ECG,
// nameLine1: TranslationBase.of(context).admission, nameLine1: TranslationBase.of(context).patient,
// nameLine2: TranslationBase.of(context).request, nameLine2: "ECG",
// icon: 'heartbeat.png'), icon: 'patient/patient_sick_leave.png'),
(int.parse(patientType) == 7 || int.parse(patientType) == 6) (int.parse(patientType) == 7 || int.parse(patientType) == 6)
? PatientProfileButton( ? PatientProfileButton(
key: key, key: key,
@ -103,19 +105,10 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget {
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
route: MEDICAL_FILE, route: PATIENT_INSURANCE_APPROVALS_NEW,
nameLine1: TranslationBase.of(context).previewHealth, nameLine1: TranslationBase.of(context).insurance,
nameLine2: TranslationBase.of(context).summaryReport, nameLine2: TranslationBase.of(context).service,
icon: 'patient/health_summary.png'), icon: 'patient/vital_signs.png'),
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: PATIENT_ECG,
nameLine1: TranslationBase.of(context).patient,
nameLine2: "ECG",
icon: 'patient/patient_sick_leave.png'),
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
@ -125,6 +118,14 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget {
nameLine1: TranslationBase.of(context).patientSick, nameLine1: TranslationBase.of(context).patientSick,
nameLine2: TranslationBase.of(context).leave, nameLine2: TranslationBase.of(context).leave,
icon: 'patient/patient_sick_leave.png'), icon: 'patient/patient_sick_leave.png'),
// PatientProfileButton(
// key: key,
// patient: patient,
// route: PATIENT_ADMISSION_REQUEST,
// nameLine1: TranslationBase.of(context).admission,
// nameLine2: TranslationBase.of(context).request,
// icon: 'heartbeat.png'),
if (patientType == "1")
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,

@ -19,6 +19,7 @@ class ExaminationIitemCard extends StatelessWidget {
return Container( return Container(
color: Colors.white, color: Colors.white,
padding: EdgeInsets.all(8), padding: EdgeInsets.all(8),
margin: EdgeInsets.only(bottom: 8),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -77,15 +78,13 @@ class ExaminationIitemCard extends StatelessWidget {
SizedBox( SizedBox(
height: 4, height: 4,
), ),
Expanded( AppText(
child: AppText(
examination.remark, examination.remark,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
fontFamily: 'Poppins', fontFamily: 'Poppins',
color: Colors.grey.shade500, color: Colors.grey.shade500,
fontSize: SizeConfig.textMultiplier * 1.8, fontSize: SizeConfig.textMultiplier * 1.8,
), ),
),
], ],
), ),
); );

@ -223,6 +223,18 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
), ),
), ),
), ),
/* ...List.generate(
widget.mySelectedExamination.length,
(index) => Container(
child: ExaminationIitemCard(
widget.mySelectedExamination[
index], () {
removeExamination(widget
.mySelectedExamination[
index]
.selectedExamination);
}),
)),*/
Column( Column(
children: widget.mySelectedExamination children: widget.mySelectedExamination
.map((examination) { .map((examination) {
@ -266,8 +278,16 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
child: AppButton( child: AppButton(
title: TranslationBase.of(context).next, title: TranslationBase.of(context).next,
loading: model.state == ViewState.BusyLocal, loading: model.state == ViewState.BusyLocal,
color: HexColor("#A5A5A5"), color: widget.mySelectedExamination != null &&
fontColor: HexColor("#5A5A5A"), widget.mySelectedExamination.length > 0
? HexColor("#D02127")
: HexColor("#A5A5A5"),
fontColor: widget.mySelectedExamination != null &&
widget.mySelectedExamination.length > 0 ? Colors.white : HexColor("#5A5A5A"),
disabled: widget.mySelectedExamination != null &&
widget.mySelectedExamination.length > 0
? false
: true,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
onPressed: () async { onPressed: () async {
await submitUpdateObjectivePage(model); await submitUpdateObjectivePage(model);

@ -9,8 +9,9 @@ import 'package:provider/provider.dart';
class StepsWidget extends StatelessWidget { class StepsWidget extends StatelessWidget {
final int index; final int index;
final Function changeCurrentTab; final Function changeCurrentTab;
final double height;
StepsWidget({Key key, this.index, this.changeCurrentTab}); StepsWidget({Key key, this.index, this.changeCurrentTab, this.height = 0.0});
// TODO : Add translation to name // TODO : Add translation to name
@override @override
@ -20,10 +21,12 @@ class StepsWidget extends StatelessWidget {
? Stack( ? Stack(
children: [ children: [
Container( Container(
height: 150, height: height == 0 ? 150 : height,
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width * 0.9,
color: Colors.transparent, color: Colors.transparent,
child: Center( child: Center(
child: Container(
width: MediaQuery.of(context).size.width * 0.87,
child: Divider( child: Divider(
color: Colors.grey, color: Colors.grey,
height: 0.75, height: 0.75,
@ -31,8 +34,9 @@ class StepsWidget extends StatelessWidget {
), ),
), ),
), ),
),
Positioned( Positioned(
top: 50, top: 43,
left: 0, left: 0,
child: InkWell( child: InkWell(
onTap: () => changeCurrentTab(0), onTap: () => changeCurrentTab(0),
@ -57,13 +61,13 @@ class StepsWidget extends StatelessWidget {
: Color(0xFFCCCCCC), : Color(0xFFCCCCCC),
), ),
child: Center( child: Center(
child: Icon(FontAwesomeIcons.check, size: 20, child: Icon(
color: Colors.white,) FontAwesomeIcons.check,
), size: 20,
), color: Colors.white,
SizedBox( )),
height:5
), ),
SizedBox(height: 5),
Column( Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
@ -72,8 +76,10 @@ class StepsWidget extends StatelessWidget {
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 12, fontSize: 12,
), ),
StatusLabel(selectedStepId: index, stepId: 0,), StatusLabel(
selectedStepId: index,
stepId: 0,
),
], ],
), ),
], ],
@ -81,11 +87,11 @@ class StepsWidget extends StatelessWidget {
), ),
), ),
Positioned( Positioned(
top: 50, top: 43,
left: MediaQuery left: MediaQuery
.of(context) .of(context)
.size .size
.width * 0.28, .width * 0.25,
child: InkWell( child: InkWell(
onTap: () => index >= 1 ? changeCurrentTab(1) : null, onTap: () => index >= 1 ? changeCurrentTab(1) : null,
child: Column( child: Column(
@ -109,12 +115,14 @@ class StepsWidget extends StatelessWidget {
: Color(0xFFCCCCCC), : Color(0xFFCCCCCC),
), ),
child: Center( child: Center(
child: Icon(FontAwesomeIcons.check, size: 20, child: Icon(
color: Colors.white,) FontAwesomeIcons.check,
), size: 20,
color: Colors.white,
)),
), ),
SizedBox( SizedBox(
height:5, height: 5,
), ),
Column( Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
@ -124,9 +132,10 @@ class StepsWidget extends StatelessWidget {
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 12, fontSize: 12,
), ),
StatusLabel(
StatusLabel(selectedStepId: index, stepId: 1,), selectedStepId: index,
stepId: 1,
),
], ],
), ),
], ],
@ -134,15 +143,14 @@ class StepsWidget extends StatelessWidget {
), ),
), ),
Positioned( Positioned(
top: 50, top: 43,
left: MediaQuery left: MediaQuery
.of(context) .of(context)
.size .size
.width * 0.52, .width * 0.50,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
if (index >= 3) if (index >= 3) changeCurrentTab(2);
changeCurrentTab(2);
}, },
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
@ -161,16 +169,18 @@ class StepsWidget extends StatelessWidget {
color: index == 2 color: index == 2
? Color(0xFFCC9B14) ? Color(0xFFCC9B14)
: index > 2 : index > 2
? Color(0xFFCC9B14) ? Color(0xFF359846)
: Color(0xFFCCCCCC), : Color(0xFFCCCCCC),
), ),
child: Center( child: Center(
child: Icon(FontAwesomeIcons.check, size: 20, child: Icon(
color: Colors.white,) FontAwesomeIcons.check,
), size: 20,
color: Colors.white,
)),
), ),
SizedBox( SizedBox(
height:5, height: 5,
), ),
Column( Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
@ -180,7 +190,10 @@ class StepsWidget extends StatelessWidget {
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 12, fontSize: 12,
), ),
StatusLabel(selectedStepId: index, stepId: 2,), StatusLabel(
selectedStepId: index,
stepId: 2,
),
], ],
), ),
], ],
@ -188,7 +201,7 @@ class StepsWidget extends StatelessWidget {
), ),
), ),
Positioned( Positioned(
top: 50, top: 43,
right: 0, right: 0,
child: InkWell( child: InkWell(
onTap: () => index >= 3 ? changeCurrentTab(4) : null, onTap: () => index >= 3 ? changeCurrentTab(4) : null,
@ -213,26 +226,29 @@ class StepsWidget extends StatelessWidget {
: Color(0xFFCCCCCC), : Color(0xFFCCCCCC),
), ),
child: Center( child: Center(
child: Icon(FontAwesomeIcons.check, size: 20, child: Icon(
color: Colors.white,) FontAwesomeIcons.check,
), size: 20,
color: Colors.white,
)),
), ),
SizedBox( SizedBox(
height:5, height: 5,
), ),
Center( Column(
child: Column( crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
AppText( AppText(
"Plan", "Plan",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
textAlign: TextAlign.center, // textAlign: TextAlign.center,
fontSize: 12, fontSize: 12,
), ),
StatusLabel(selectedStepId: index, stepId: 3,), StatusLabel(
], selectedStepId: index,
stepId: 3,
), ),
],
), ),
], ],
), ),
@ -243,11 +259,8 @@ class StepsWidget extends StatelessWidget {
: Stack( : Stack(
children: [ children: [
Container( Container(
height: 150, height: height == 0 ? 150 : height,
width: MediaQuery width: MediaQuery.of(context).size.width,
.of(context)
.size
.width,
color: Colors.transparent, color: Colors.transparent,
child: Center( child: Center(
child: Divider( child: Divider(
@ -258,7 +271,7 @@ class StepsWidget extends StatelessWidget {
), ),
), ),
Positioned( Positioned(
top: 50, top: 43,
right: 0, right: 0,
child: InkWell( child: InkWell(
onTap: () => changeCurrentTab(0), onTap: () => changeCurrentTab(0),
@ -283,24 +296,32 @@ class StepsWidget extends StatelessWidget {
: Color(0xFFCCCCCC), : Color(0xFFCCCCCC),
), ),
child: Center( child: Center(
child: Icon(FontAwesomeIcons.check, size: 20, child: Icon(
color: Colors.white,) FontAwesomeIcons.check,
), size: 20,
), color: Colors.white,
SizedBox( )),
height:5
), ),
SizedBox(height: 5),
Column(
children: [
AppText( AppText(
"شخصي", "شخصي",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 16, fontSize: 16,
), ),
StatusLabel(
selectedStepId: index,
stepId: 0,
),
],
),
], ],
), ),
), ),
), ),
Positioned( Positioned(
top: 50, top: 43,
right: MediaQuery right: MediaQuery
.of(context) .of(context)
.size .size
@ -328,24 +349,32 @@ class StepsWidget extends StatelessWidget {
: Color(0xFFCCCCCC), : Color(0xFFCCCCCC),
), ),
child: Center( child: Center(
child: Icon(FontAwesomeIcons.check, size: 20, child: Icon(
color: Colors.white,) FontAwesomeIcons.check,
), size: 20,
), color: Colors.white,
SizedBox( )),
height:5
), ),
SizedBox(height: 5),
Column(
children: [
AppText( AppText(
"هدف", "هدف",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize:14, fontSize: 14,
),
StatusLabel(
selectedStepId: index,
stepId: 1,
),
],
), ),
], ],
), ),
), ),
), ),
Positioned( Positioned(
top: 50, top: 43,
right: MediaQuery right: MediaQuery
.of(context) .of(context)
.size .size
@ -373,20 +402,29 @@ class StepsWidget extends StatelessWidget {
: Color(0xFFCCCCCC), : Color(0xFFCCCCCC),
), ),
child: Center( child: Center(
child: Icon(FontAwesomeIcons.check, size: 20, child: Icon(
color: Colors.white,) FontAwesomeIcons.check,
), size: 20,
color: Colors.white,
)),
), ),
SizedBox( SizedBox(
height:5, height: 5,
), ),
Padding( Padding(
padding: const EdgeInsets.only(right: 2), padding: const EdgeInsets.only(right: 2),
child: AppText( child: Column(
children: [
AppText(
"تقدير", "تقدير",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize:14, fontSize: 14,
),
StatusLabel(
selectedStepId: index,
stepId: 2,
),
],
), ),
), ),
], ],
@ -394,12 +432,12 @@ class StepsWidget extends StatelessWidget {
), ),
), ),
Positioned( Positioned(
top: 50, top: 43,
left: 0, left: 0,
child: InkWell( child: InkWell(
onTap: () => index >= 3 ? changeCurrentTab(4) : null, onTap: () => index >= 3 ? changeCurrentTab(4) : null,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
Container( Container(
width: 38, width: 38,
@ -419,19 +457,29 @@ class StepsWidget extends StatelessWidget {
: Color(0xFFCCCCCC), : Color(0xFFCCCCCC),
), ),
child: Center( child: Center(
child: Icon(FontAwesomeIcons.check, size: 20, child: Icon(
color: Colors.white,) FontAwesomeIcons.check,
), size: 20,
color: Colors.white,
)),
), ),
SizedBox( SizedBox(
height:5, height: 5,
), ),
Container( Container(
margin: EdgeInsets.only(right:index == 3? 15:0), margin: EdgeInsets.only(right: index == 3 ? 15 : 0),
child: AppText( child: Column(
children: [
AppText(
"خطة", "خطة",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize:14, fontSize: 14,
),
StatusLabel(
selectedStepId: index,
stepId: 3,
),
],
), ),
), ),
], ],
@ -445,7 +493,9 @@ class StepsWidget extends StatelessWidget {
class StatusLabel extends StatelessWidget { class StatusLabel extends StatelessWidget {
const StatusLabel({ const StatusLabel({
Key key, this.stepId, this.selectedStepId, Key key,
this.stepId,
this.selectedStepId,
}) : super(key: key); }) : super(key: key);
final int stepId; final int stepId;
@ -457,24 +507,30 @@ class StatusLabel extends StatelessWidget {
width: 65, width: 65,
padding: EdgeInsets.symmetric(horizontal: 2, vertical: 3), padding: EdgeInsets.symmetric(horizontal: 2, vertical: 3),
decoration: BoxDecoration( decoration: BoxDecoration(
color: stepId == selectedStepId ? Color(0xFFF1E9D3) : stepId < color: stepId == selectedStepId
selectedStepId ? Color(0xFFD8E8DB) : Color(0xFFCCCCCC), ? Color(0xFFF1E9D3)
: stepId < selectedStepId
? Color(0xFFD8E8DB)
: Color(0xFFCCCCCC),
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(5.0), Radius.circular(5.0),
), ),
border: Border.all( border: Border.all(color: HexColor('#707070'), width: 0.30),
color: HexColor('#707070'),
width: 0.30),
), ),
child: AppText( child: AppText(
stepId == selectedStepId ? "inProgress" : stepId < selectedStepId stepId == selectedStepId
? "inProgress"
: stepId < selectedStepId
? "Completed" ? "Completed"
: " Locked ", : " Locked ",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
textAlign: TextAlign.center, textAlign: TextAlign.center,
fontSize: 10, fontSize: 10,
color: stepId == selectedStepId ? Color(0xFFCC9B14) : stepId < color: stepId == selectedStepId
selectedStepId ? Color(0xFF359846) : Color(0xFF969696), ? Color(0xFFCC9B14)
: stepId < selectedStepId
? Color(0xFF359846)
: Color(0xFF969696),
), ),
); );
} }

@ -46,37 +46,6 @@ class UpdateChiefComplaints extends StatelessWidget {
child: CustomValidationError( child: CustomValidationError(
error: complaintsControllerError, error: complaintsControllerError,
)), )),
// Container(
// margin:
// EdgeInsets.only(left: 10, right: 10, top: 15),
// child: TextFields(
// hasLabelText: complaintsController.text != ''
// ? true
// : false,
// hintText: TranslationBase
// .of(context)
// .addChiefComplaints,
// fontSize: 13.5,
// // hintColor: Colors.black,
// showLabelText: true,
// fontWeight: FontWeight.w600,
// maxLines: 25,
// minLines: 13,
// controller: complaintsController,
// validator: (value) {
// if (value == null || value == "")
// return TranslationBase.of(context)
// .emptyMessage;
// else if (value.length < 25)
// return TranslationBase
// .of(context)
// .chiefComplaintLength;
// //"";
// else
// return null;
// }),
// ),
SizedBox( SizedBox(
height: 20, height: 20,
), ),

@ -1,4 +1,5 @@
import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:autocomplete_textfield/autocomplete_textfield.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
@ -8,21 +9,19 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/master_key_dailog.dart';
import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart';
import 'package:doctor_app_flutter/widgets/shared/master_key_checkbox_search_allergies_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../custom_validation_error.dart';
class UpdateAllergiesWidget extends StatefulWidget { class UpdateAllergiesWidget extends StatefulWidget {
final List<MySelectedAllergy> myAllergiesList; List<MySelectedAllergy> myAllergiesList;
UpdateAllergiesWidget({Key key, this.myAllergiesList}); UpdateAllergiesWidget({Key key, this.myAllergiesList});
@ -34,31 +33,68 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
changeAllState() {
setState(() {
});
}
return Column( return Column(
children: [ children: [
Container( InkWell(
margin: EdgeInsets.only(left: 10, right: 10, top: 15), onTap: () {
child: TextFields( openAllergiesList(context, changeAllState);
hintText: TranslationBase.of(context).addAllergies,
borderColor: HexColor('#707070'),
borderWidth: 0.30,
fontSize: 13.5,
borderRadius: 12,
onTapTextFields: () {
openAllergiesList(context);
}, },
readOnly: true, child: Container(
suffixIcon: EvaIcons.plusCircleOutline, padding: EdgeInsets.symmetric(
suffixIconColor: Color(0xFF2B353E), vertical: 8, horizontal: 8.0),
fontWeight: FontWeight.w600, margin:
// controller: messageController, EdgeInsets.symmetric(vertical: 8),
validator: (value) { decoration: BoxDecoration(
if (value == null) border: Border.all(
return TranslationBase.of(context).emptyMessage; color: Colors.grey.shade400,
else width: 0.5),
return null; borderRadius: BorderRadius.all(
}), Radius.circular(8),
),
color: Colors.white,
),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
AppText(
"${TranslationBase.of(context).addAllergies}",
fontSize: SizeConfig
.textMultiplier *
1.8,
color: Colors.black,
fontWeight: FontWeight.bold,
),
AppText(
"${TranslationBase.of(context).searchHere}",
fontSize: SizeConfig
.textMultiplier *
1.8,
color: Colors.grey.shade700,
fontWeight: FontWeight.bold,
),
],
)),
Icon(
Icons.add_box_rounded,
size: 25,
)
],
),
),
), ),
SizedBox( SizedBox(
height: 20, height: 20,
@ -186,49 +222,36 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
print(allergy); print(allergy);
} }
openAllergiesList(BuildContext context) { openAllergiesList(BuildContext context, Function changeParentState) {
showModalBottomSheet( showModalBottomSheet(
backgroundColor: Colors.white, backgroundColor: Colors.white,
isScrollControlled: true, isScrollControlled: true,
isDismissible: false,
context: context, context: context,
builder: (context) { builder: (context) {
return AddAllergies( return AddAllergies(
addAllergiesFun: (MySelectedAllergy mySelectedAllergy) { myAllergiesList: widget.myAllergiesList,
if (mySelectedAllergy.selectedAllergySeverity == null || addAllergiesFun: (List<MySelectedAllergy> mySelectedAllergy) {
mySelectedAllergy.selectedAllergy == null) { bool isAllDataFilled = true;
mySelectedAllergy.forEach((element) {
if (element.selectedAllergySeverity == null) {
isAllDataFilled = false;
}
});
if (isAllDataFilled) {
mySelectedAllergy.forEach((element) {
if (!widget.myAllergiesList.contains(element)) {
widget.myAllergiesList.add(element);
}
});
changeParentState();
Navigator.of(context).pop();
} else {
helpers.showErrorToast(TranslationBase helpers.showErrorToast(TranslationBase
.of(context) .of(context)
.requiredMsg); .requiredMsg);
} else {
setState(() {
List<MySelectedAllergy> allergy =
// ignore: missing_return
widget.myAllergiesList
.where((element) =>
mySelectedAllergy.selectedAllergy.id ==
element.selectedAllergy.id)
.toList();
if (allergy.isEmpty) {
widget.myAllergiesList.add(mySelectedAllergy);
Navigator.of(context).pop();
} else {
allergy.first.selectedAllergy =
mySelectedAllergy.selectedAllergy;
allergy.first.selectedAllergySeverity =
mySelectedAllergy.selectedAllergySeverity;
allergy.first.remark = mySelectedAllergy.remark;
allergy.first.isChecked = mySelectedAllergy.isChecked;
Navigator.of(context).pop();
// helpers.showErrorToast(TranslationBase
// .of(context)
// .itemExist);
} }
}); });
}
},);
}); });
} }
@ -236,8 +259,9 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
class AddAllergies extends StatefulWidget { class AddAllergies extends StatefulWidget {
final Function addAllergiesFun; final Function addAllergiesFun;
final List<MySelectedAllergy> myAllergiesList;
const AddAllergies({Key key, this.addAllergiesFun}) : super(key: key); const AddAllergies({Key key, this.addAllergiesFun, this.myAllergiesList}) : super(key: key);
@override @override
_AddAllergiesState createState() => _AddAllergiesState(); _AddAllergiesState createState() => _AddAllergiesState();
@ -251,7 +275,13 @@ class _AddAllergiesState extends State<AddAllergies> {
TextEditingController remarkController = TextEditingController(); TextEditingController remarkController = TextEditingController();
TextEditingController severityController = TextEditingController(); TextEditingController severityController = TextEditingController();
TextEditingController allergyController = TextEditingController(); TextEditingController allergyController = TextEditingController();
List<MySelectedAllergy> myAllergiesListLocal;
@override
initState(){
super.initState();
myAllergiesListLocal = [...widget.myAllergiesList];
}
GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<MasterKeyModel>>(); GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<MasterKeyModel>>();
bool isFormSubmitted = false; bool isFormSubmitted = false;
@ -291,7 +321,7 @@ class _AddAllergiesState extends State<AddAllergies> {
.of(context) .of(context)
.size; .size;
return FractionallySizedBox( return FractionallySizedBox(
heightFactor: 0.7, heightFactor: 1,
child: BaseView<SOAPViewModel>( child: BaseView<SOAPViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
if (model.allergiesList.length == 0) { if (model.allergiesList.length == 0) {
@ -305,220 +335,170 @@ class _AddAllergiesState extends State<AddAllergies> {
AppScaffold( AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: false, isShowAppBar: false,
body: SingleChildScrollView( body: Center(
child: Center( child: Container(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox( Container(
height: 16, padding: EdgeInsets.only(
), left: 0, right: 5, bottom: 5, top: 5),
AppText( decoration: BoxDecoration(
TranslationBase color: Colors.white,
.of(context) ),
.addAllergies, height: 115,
child: Container(
padding: EdgeInsets.only(
left: 10, right: 10),
margin: EdgeInsets.only(top: 40),
child: Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
RichText(
text: TextSpan(
style: TextStyle(
fontSize:20,
color: Colors.black),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(context).
addAllergies,
style: TextStyle(
color: Color(0xFF2B353E),
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 16, fontFamily: 'Poppins',
fontSize: 20)),
],
), ),
SizedBox(
height: 16,
), ),
Container( InkWell(
height: screenSize.height * 0.070, onTap: () {
child: InkWell( Navigator.pop(context);
onTap: model.allergiesList != null },
? () { child: Icon(FontAwesomeIcons.times,
setState(() { size: 30,
_selectedAllergy = null; color: Color(0xFF2B353E)))
allergyController.text = null; ],
}); ),
} ],
: null, ),
child: _selectedAllergy==null? AutoCompleteTextField<MasterKeyModel>(
decoration: textFieldSelectorDecoration(
TranslationBase
.of(context)
.selectAllergy,
_selectedAllergy != null
? _selectedAllergy.nameEn
: null, true, icon: EvaIcons.search),
itemSubmitted: (item) =>
setState(() {
_selectedAllergy = item;
allergyController.text =
projectViewModel.isArabic
? _selectedAllergy
.nameAr
: _selectedAllergy
.nameEn;
}),
key: key,
suggestions: model.allergiesList,
itemBuilder: (context, suggestion) =>
new Padding(
child: Texts(
projectViewModel.isArabic ? suggestion
.nameAr : suggestion.nameEn),
padding: EdgeInsets.all(2.0)),
itemSorter: (a, b) => 1,
itemFilter: (suggestion, input) =>
suggestion.nameAr.toLowerCase().startsWith(
input.toLowerCase()) ||
suggestion.nameEn.toLowerCase()
.startsWith(input.toLowerCase()),
) :
TextFields(
onTapTextFields: model.allergiesList != null
? () {
setState(() {
_selectedAllergy = null;
allergyController.text = null;
});
}
: null,
hasLabelText: allergyController.text !=
'' ? true : false,
showLabelText: true,
hintText: TranslationBase
.of(context)
.selectAllergy,
fontSize: 13.5,
readOnly: true,
fontWeight: FontWeight.w600,
maxLines: 2,
minLines: 1,
controller: allergyController,
suffixIcon: EvaIcons.search,
validator: (value) {
if (value == null)
return TranslationBase
.of(context)
.emptyMessage;
else
return null;
})
), ),
), ),
if(isFormSubmitted && _selectedAllergy == null)
CustomValidationError(),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
TextFields( SizedBox(
onTapTextFields: model height: 16,
.allergySeverityList != null ),
? () { Expanded(
MasterKeyDailog dialog = MasterKeyDailog( child: Center(
list: model.allergySeverityList, child: FractionallySizedBox(
okText: TranslationBase widthFactor: 0.9,
.of(context) child: Center(
.ok, child: NetworkBaseView(
okFunction: (selectedValue) { baseViewModel: model,
child: MasterKeyCheckboxSearchAllergiesWidget(
model: model,
masterList: model.allergiesList,
removeAllergy: (master) {
setState(() { setState(() {
_selectedAllergySeverity = removeAllergyFromLocalList(master);
selectedValue;
severityController.text =
projectViewModel.isArabic
? _selectedAllergySeverity
.nameAr
: _selectedAllergySeverity
.nameEn;
}); });
}, },
); addAllergy: (MySelectedAllergy mySelectedAllergy){
showDialog( AddAllergyLocally(mySelectedAllergy);
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
}, },
); addSelectedAllergy: ()=>
} widget.addAllergiesFun(myAllergiesListLocal)
: null, ,
hasLabelText: severityController.text != isServiceSelected: (master) =>isServiceSelected(master),
'' ? true : false, getServiceSelectedAllergy: (master)=>getSelectedAllergy(master),
showLabelText: true, ),
hintText: TranslationBase ),
.of(context)
.selectSeverity,
fontSize: 13.5,
readOnly: true,
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
maxLines: 2,
minLines: 1,
controller: severityController,
validator: (value) {
if (value == null)
return TranslationBase
.of(context)
.emptyMessage;
else
return null;
}), SizedBox(
height: 5,
), ),
if(isFormSubmitted &&
_selectedAllergySeverity == null)
CustomValidationError(),
SizedBox(
height: 10,
), ),
Container(
margin: EdgeInsets.only(
left: 0, right: 0, top: 15),
child: TextFields(
hasLabelText: remarkController.text != ''?true:false,
showLabelText: true,
hintText: TranslationBase.of(context).remarks,
fontSize: 13.5,
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
maxLines: 25,
minLines: 10,
controller: remarkController,
validator: (value) {
if (value == null)
return TranslationBase
.of(context)
.emptyMessage;
else
return null;
}),
), SizedBox(
height: 10,
), ),
AppButton(
title: TranslationBase.of(context).add.toUpperCase(),
onPressed: () {
setState(() {
isFormSubmitted = true;
});
if(_selectedAllergy !=null && _selectedAllergySeverity !=null) {
MySelectedAllergy mySelectedAllergy = new MySelectedAllergy(
remark: remarkController.text,
selectedAllergy: _selectedAllergy,
isChecked: true,
selectedAllergySeverity: _selectedAllergySeverity,);
widget.addAllergiesFun(mySelectedAllergy);
}
},
), ),
] ]
), ),
), ),
)
), ),
)),
), ),
); );
} }
isServiceSelected(MasterKeyModel masterKey) {
Iterable<MySelectedAllergy> allergy =
myAllergiesListLocal.where((element) =>
masterKey.id == element.selectedAllergy.id &&
masterKey.typeId == element.selectedAllergy.typeId &&
element.isChecked);
if (allergy.length > 0) {
return true;
}
return false;
}
removeAllergyFromLocalList(MasterKeyModel masterKey) {
myAllergiesListLocal.removeWhere((element) =>
element.selectedAllergy.id == masterKey.id);
}
MySelectedAllergy getSelectedAllergy(MasterKeyModel masterKey) {
Iterable<MySelectedAllergy> allergy =
myAllergiesListLocal.where((element) =>
masterKey.id == element.selectedAllergy.id &&
masterKey.typeId == element.selectedAllergy.typeId &&
element.isChecked);
if (allergy.length > 0) {
return allergy.first;
}
return null;
}
AddAllergyLocally(MySelectedAllergy mySelectedAllergy) {
if (
mySelectedAllergy.selectedAllergy == null) {
helpers.showErrorToast(TranslationBase
.of(context)
.requiredMsg);
} else {
setState(() {
List<MySelectedAllergy> allergy =
// ignore: missing_return
myAllergiesListLocal
.where((element) =>
mySelectedAllergy.selectedAllergy.id ==
element.selectedAllergy.id)
.toList();
if (allergy.isEmpty) {
myAllergiesListLocal.add(mySelectedAllergy);
// Navigator.of(context).pop();
} else {
allergy.first.selectedAllergy =
mySelectedAllergy.selectedAllergy;
allergy.first.selectedAllergySeverity =
mySelectedAllergy.selectedAllergySeverity;
allergy.first.remark = mySelectedAllergy.remark;
allergy.first.isChecked = mySelectedAllergy.isChecked;
// Navigator.of(context).pop();
// helpers.showErrorToast(TranslationBase
// .of(context)
// .itemExist);
}
});
}}
} }

@ -9,6 +9,7 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/master_key_checkbox_search_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/master_key_checkbox_search_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart';
@ -49,28 +50,60 @@ class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget>
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return Column( return Column(
children: [ children: [
Container( InkWell(
margin: EdgeInsets.only(left: 10, right: 10, top: 15), onTap: () {
child: TextFields(
hintText: TranslationBase.of(context).addHistory,
borderColor: HexColor('#707070'),
borderWidth: 0.30,
fontSize: 13.5,
borderRadius: 12,
onTapTextFields: () {
openHistoryList(context); openHistoryList(context);
}, },
suffixIcon: EvaIcons.plusCircleOutline, child: Container(
suffixIconColor: Color(0xFF2B353E), padding: EdgeInsets.symmetric(
readOnly: true, vertical: 8, horizontal: 8.0),
fontWeight: FontWeight.w600, margin:
// controller: messageController, EdgeInsets.symmetric(vertical: 8),
validator: (value) { decoration: BoxDecoration(
if (value == null) border: Border.all(
return TranslationBase.of(context).emptyMessage; color: Colors.grey.shade400,
else width: 0.5),
return null; borderRadius: BorderRadius.all(
}), Radius.circular(8),
),
color: Colors.white,
),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
AppText(
"${TranslationBase.of(context).addHistory}",
fontSize: SizeConfig
.textMultiplier *
1.8,
color: Colors.black,
fontWeight: FontWeight.bold,
),
AppText(
"${TranslationBase.of(context).searchHere}",
fontSize: SizeConfig
.textMultiplier *
1.8,
color: Colors.grey.shade700,
fontWeight: FontWeight.bold,
),
],
)),
Icon(
Icons.add_box_rounded,
size: 25,
)
],
),
),
), ),
SizedBox( SizedBox(
height: 20, height: 20,
@ -143,10 +176,6 @@ class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget>
} }
removeHistory(MasterKeyModel historyKey) { removeHistory(MasterKeyModel historyKey) {
// Iterable<MasterKeyModel> history = widget.myHistoryList.where((element) =>
// masterKey.id == element.id && masterKey.typeId == element.typeId);
//
List<MySelectedHistory> history = List<MySelectedHistory> history =
// ignore: missing_return // ignore: missing_return
widget.myHistoryList.where((element) => widget.myHistoryList.where((element) =>

@ -205,10 +205,11 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
doctorID: ''); doctorID: '');
await model.getPatientChiefComplaint(getChiefComplaintReqModel); await model.getPatientChiefComplaint(getChiefComplaintReqModel);
if (model.patientChiefComplaintList.isNotEmpty) { if (model.patientChiefComplaintList.isNotEmpty) {
isChiefExpand = true;
complaintsController.text = helpers.parseHtmlString( complaintsController.text = helpers.parseHtmlString(
model.patientChiefComplaintList[0].chiefComplaint); model.patientChiefComplaintList[0].chiefComplaint);
illnessController.text = model.patientChiefComplaintList[0].hopi; illnessController.text = model.patientChiefComplaintList[0].hopi;
medicationController.text = model.patientChiefComplaintList[0].currentMedication + '\n \n'; medicationController.text =!(model.patientChiefComplaintList[0].currentMedication).isNotEmpty ? model.patientChiefComplaintList[0].currentMedication + '\n \n':model.patientChiefComplaintList[0].currentMedication;
} }
await getHistory(model); await getHistory(model);
@ -304,7 +305,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
isExpanded: isAllergiesExpand, isExpanded: isAllergiesExpand,
), ),
SizedBox( SizedBox(
height:MediaQuery.of(context).size.height * 0.2, height:MediaQuery.of(context).size.height * 0.16,
), ),
], ],
), ),
@ -324,13 +325,13 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
height: MediaQuery height: MediaQuery
.of(context) .of(context)
.size .size
.height * 0.15, .height * 0.1,
width: double.infinity, width: double.infinity,
child: Column( child: Column(
children: [ children: [
SizedBox( SizedBox(
height: 15, height: 10,
), ),
Container(child: FractionallySizedBox( Container(child: FractionallySizedBox(
widthFactor: .80, widthFactor: .80,
@ -351,7 +352,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
), ),
),), ),),
SizedBox( SizedBox(
height: 15, height: 5,
), ),
], ],
),), ),),

@ -134,8 +134,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(10.0), Radius.circular(10.0),
), ),
border: border: Border.all(color: Colors.grey[200], width: 0.5),
Border.all(color: Colors.grey[200], width: 0.5),
), ),
child: HeaderBodyExpandableNotifier( child: HeaderBodyExpandableNotifier(
headerWidget: Row( headerWidget: Row(
@ -145,14 +144,10 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
padding: EdgeInsets.all(12.0), padding: EdgeInsets.all(12.0),
child: Row( child: Row(
children: [ children: [
Texts( Texts(TranslationBase.of(context).assessment,
TranslationBase.of(context) variant:
.assessment, isAssessmentExpand ? "bodyText" : '',
variant: isAssessmentExpand bold: isAssessmentExpand ? true : false,
? "bodyText"
: '',
bold:
isAssessmentExpand ? true : false,
color: Colors.black), color: Colors.black),
Icon( Icon(
FontAwesomeIcons.asterisk, FontAwesomeIcons.asterisk,
@ -165,8 +160,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
InkWell( InkWell(
onTap: () { onTap: () {
setState(() { setState(() {
isAssessmentExpand = isAssessmentExpand = !isAssessmentExpand;
!isAssessmentExpand;
}); });
}, },
child: Icon(isAssessmentExpand child: Icon(isAssessmentExpand
@ -181,8 +175,8 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
Column( Column(
children: [ children: [
Container( Container(
margin: EdgeInsets.only( margin:
left: 5, right: 5, top: 15), EdgeInsets.only(left: 5, right: 5, top: 15),
child: TextFields( child: TextFields(
hintText: TranslationBase.of(context) hintText: TranslationBase.of(context)
.addAssessment, .addAssessment,
@ -231,13 +225,11 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
), ),
Container( Container(
child: AppText( child: AppText(
assessment.selectedICD assessment.selectedICD.code
.code
.trim() .trim()
.toUpperCase() ?? .toUpperCase() ??
"", "",
fontWeight: fontWeight: FontWeight.w700,
FontWeight.w700,
fontSize: 11, fontSize: 11,
), ),
), ),
@ -250,25 +242,22 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
TranslationBase.of( TranslationBase.of(context)
context)
.ICDName + .ICDName +
" : ", " : ",
fontSize: 13, fontSize: 13,
color: Colors.grey, color: Colors.grey,
), ),
Container( Container(
width: width: MediaQuery.of(context)
MediaQuery.of(context)
.size .size
.width * .width *
0.29, 0.29,
child: AppText( child: AppText(
assessment.selectedICD assessment
.description .selectedICD.description
.toString(), .toString(),
fontWeight: fontWeight: FontWeight.w700,
FontWeight.w700,
fontSize: 10, fontSize: 10,
), ),
), ),
@ -279,8 +268,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
MainAxisAlignment.start, MainAxisAlignment.start,
children: [ children: [
AppText( AppText(
TranslationBase.of( TranslationBase.of(context)
context)
.appointmentNo, .appointmentNo,
fontSize: 10, fontSize: 10,
color: Colors.grey, color: Colors.grey,
@ -289,8 +277,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
assessment.appointmentId assessment.appointmentId
.toString(), .toString(),
fontSize: 11, fontSize: 11,
fontWeight: fontWeight: FontWeight.w700,
FontWeight.w700,
), ),
], ],
), ),
@ -299,8 +286,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
MainAxisAlignment.start, MainAxisAlignment.start,
children: [ children: [
AppText( AppText(
TranslationBase.of( TranslationBase.of(context)
context)
.condition + .condition +
" : ", " : ",
fontSize: 10, fontSize: 10,
@ -315,8 +301,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
.selectedDiagnosisCondition .selectedDiagnosisCondition
.nameEn, .nameEn,
fontSize: 11, fontSize: 11,
fontWeight: fontWeight: FontWeight.w700,
FontWeight.w700,
), ),
], ],
), ),
@ -325,8 +310,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
MainAxisAlignment.start, MainAxisAlignment.start,
children: [ children: [
AppText( AppText(
TranslationBase.of( TranslationBase.of(context)
context)
.dType + .dType +
' : ', ' : ',
fontSize: 10, fontSize: 10,
@ -341,30 +325,25 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
.selectedDiagnosisType .selectedDiagnosisType
.nameEn, .nameEn,
fontSize: 11, fontSize: 11,
fontWeight: fontWeight: FontWeight.w700,
FontWeight.w700,
), ),
], ],
), ),
if (assessment.doctorName != if (assessment.doctorName != null)
null)
Row( Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.start, MainAxisAlignment.start,
children: [ children: [
AppText( AppText(
TranslationBase.of( TranslationBase.of(context)
context)
.doc, .doc,
fontSize: 10, fontSize: 10,
color: Colors.grey, color: Colors.grey,
), ),
AppText( AppText(
assessment.doctorName ?? assessment.doctorName ?? '',
'',
fontSize: 11, fontSize: 11,
fontWeight: fontWeight: FontWeight.w700,
FontWeight.w700,
), ),
], ],
), ),
@ -379,10 +358,8 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
height: 6, height: 6,
), ),
AppText( AppText(
assessment.remark != assessment.remark != null ||
null || assessment.remark ==
assessment
.remark ==
'' ''
? TranslationBase.of( ? TranslationBase.of(
context) context)
@ -393,16 +370,14 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
color: Colors.grey, color: Colors.grey,
), ),
Container( Container(
width: width: MediaQuery.of(context)
MediaQuery.of(context)
.size .size
.width * .width *
0.38, 0.38,
child: AppText( child: AppText(
assessment.remark ?? "", assessment.remark ?? "",
fontSize: 11, fontSize: 11,
fontWeight: fontWeight: FontWeight.w700,
FontWeight.w700,
), ),
), ),
], ],
@ -416,8 +391,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
Row( Row(
children: [ children: [
AppText( AppText(
assessment.createdOn != assessment.createdOn != null
null
? DateTime.parse( ? DateTime.parse(
assessment assessment
.createdOn) .createdOn)
@ -426,8 +400,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
: DateTime.now() : DateTime.now()
.day .day
.toString(), .toString(),
fontWeight: fontWeight: FontWeight.bold,
FontWeight.bold,
fontSize: 15, fontSize: 15,
), ),
AppText(" "), AppText(" "),
@ -455,8 +428,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
), ),
InkWell( InkWell(
onTap: () { onTap: () {
openAssessmentDialog( openAssessmentDialog(context,
context,
isUpdate: true, isUpdate: true,
assessment: assessment, assessment: assessment,
model: model); model: model);
@ -496,7 +468,57 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
DividerWithSpacesAround( DividerWithSpacesAround(
height: 30, height: 30,
), ),
Row( // Row(
// children: [
// Container(
// width: MediaQuery.of(context).size.width * 0.4,
// child: AppButton(
// title: 'Previous',
// color: Colors.white38,
// fontColor: Colors.black,
// fontWeight: FontWeight.w700,
// loading: model.state == ViewState.BusyLocal,
// onPressed: () async {
// Navigator.pop(context);
// },
// ),
// ),
// SizedBox(
// width: MediaQuery.of(context).size.width * 0.05,
// ),
// Container(
// width: MediaQuery.of(context).size.width * 0.4,
// child: AppButton(
// title: TranslationBase.of(context).next,
// fontWeight: FontWeight.w700,
// loading: model.state == ViewState.BusyLocal,
// onPressed: () async {
// if (widget.mySelectedAssessmentList.isEmpty) {
// helpers.showErrorToast(
// TranslationBase.of(context)
// .assessmentErrorMsg);
// } else {
// widget.changePageViewIndex(3);
// widget.changeLoadingState(true);
// }
// },
// ),
// ),
// ],
// ),
SizedBox(
height: 130,
),
],
),
),
),
),
),
bottomSheet: Padding(
padding: const EdgeInsets.all(12.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Container( Container(
width: MediaQuery.of(context).size.width * 0.4, width: MediaQuery.of(context).size.width * 0.4,
@ -507,7 +529,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
loading: model.state == ViewState.BusyLocal, loading: model.state == ViewState.BusyLocal,
onPressed: () async { onPressed: () async {
Navigator.pop(context); widget.changePageViewIndex(1);
}, },
), ),
), ),
@ -523,8 +545,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
onPressed: () async { onPressed: () async {
if (widget.mySelectedAssessmentList.isEmpty) { if (widget.mySelectedAssessmentList.isEmpty) {
helpers.showErrorToast( helpers.showErrorToast(
TranslationBase.of(context) TranslationBase.of(context).assessmentErrorMsg);
.assessmentErrorMsg);
} else { } else {
widget.changePageViewIndex(3); widget.changePageViewIndex(3);
widget.changeLoadingState(true); widget.changeLoadingState(true);
@ -534,15 +555,9 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
), ),
], ],
), ),
SizedBox(
height: 30,
),
],
), ),
), ),
), );
),
)));
} }
openAssessmentDialog(BuildContext context, openAssessmentDialog(BuildContext context,

@ -35,7 +35,9 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
List<MySelectedExamination> mySelectedExamination = List(); List<MySelectedExamination> mySelectedExamination = List();
List<MySelectedAssessment> mySelectedAssessment = List(); List<MySelectedAssessment> mySelectedAssessment = List();
GetPatientProgressNoteResModel patientProgressNote = GetPatientProgressNoteResModel(); GetPatientProgressNoteResModel patientProgressNote =
GetPatientProgressNoteResModel();
changePageViewIndex(pageIndex) { changePageViewIndex(pageIndex) {
if (pageIndex != _currentIndex) changeLoadingState(true); if (pageIndex != _currentIndex) changeLoadingState(true);
_controller.jumpToPage(pageIndex); _controller.jumpToPage(pageIndex);
@ -66,7 +68,6 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
// baseViewModel: model, // baseViewModel: model,
isLoading: _isLoading, isLoading: _isLoading,
isShowAppBar: false, isShowAppBar: false,
// appBarTitle: TranslationBase.of(context).healthRecordInformation,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -79,33 +80,27 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
// PatientPageHeaderWidget(patient), // PatientPageHeaderWidget(patient),
PatientProfileHeaderNewDesign(patient, '7', '7'), PatientProfileHeaderNewDesign(patient, '7', '7', height: MediaQuery.of(context).size.height * 0.28,),
Container( Container(
width: double.infinity, width: double.infinity,
height: 1, height: 1,
color: Color(0xffCCCCCC), color: Color(0xffCCCCCC),
), ),
FractionallySizedBox(
child: SingleChildScrollView(
child: Container(
color: Theme.of(context).scaffoldBackgroundColor,
height: MediaQuery.of(context).size.height * 0.75,
child: Column(
children: [
Container( Container(
color: Theme.of(context).scaffoldBackgroundColor,
margin: EdgeInsets.only( margin: EdgeInsets.only(
left: MediaQuery.of(context).size.width * left: MediaQuery.of(context).size.width * 0.05,
0.05, right: MediaQuery.of(context).size.width * 0.05),
right: MediaQuery.of(context).size.width *
0.05),
child: StepsWidget( child: StepsWidget(
index: _currentIndex, index: _currentIndex,
changeCurrentTab: changePageViewIndex, changeCurrentTab: changePageViewIndex,
height: MediaQuery.of(context).size.height * 0.20,
), ),
), ),
Expanded( Container(
color: Theme.of(context).scaffoldBackgroundColor,
height: MediaQuery.of(context).size.height * 0.50,
child: PageView( child: PageView(
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
controller: _controller, controller: _controller,
onPageChanged: (index) { onPageChanged: (index) {
@ -120,37 +115,24 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
myAllergiesList: myAllergiesList, myAllergiesList: myAllergiesList,
myHistoryList: myHistoryList, myHistoryList: myHistoryList,
patientInfo: patient, patientInfo: patient,
changeLoadingState: changeLoadingState changeLoadingState: changeLoadingState),
),
UpdateObjectivePage( UpdateObjectivePage(
changePageViewIndex: changePageViewIndex, changePageViewIndex: changePageViewIndex,
mySelectedExamination: mySelectedExamination: mySelectedExamination,
mySelectedExamination,
patientInfo: patient, patientInfo: patient,
changeLoadingState: changeLoadingState changeLoadingState: changeLoadingState),
),
UpdateAssessmentPage( UpdateAssessmentPage(
changePageViewIndex: changePageViewIndex, changePageViewIndex: changePageViewIndex,
mySelectedAssessmentList: mySelectedAssessmentList: mySelectedAssessment,
mySelectedAssessment,
patientInfo: patient, patientInfo: patient,
changeLoadingState: changeLoadingState changeLoadingState: changeLoadingState),
),
UpdatePlanPage( UpdatePlanPage(
changePageViewIndex: changePageViewIndex, changePageViewIndex: changePageViewIndex,
patientInfo: patient, patientInfo: patient,
patientProgressNote: patientProgressNote, patientProgressNote: patientProgressNote,
changeLoadingState: changeLoadingState changeLoadingState: changeLoadingState)
)
], ],
), ),
),
],
),
),
),
) )
], ],
), ),

@ -98,7 +98,7 @@ class _AppDrawerState extends State<AppDrawer> {
// " or " + // " or " +
// TranslationBase.of(context).leaves, // TranslationBase.of(context).leaves,
DoctorApp.leaves, DoctorApp.reschedule__1,
// subTitle: , // subTitle: ,
), ),
onTap: () { onTap: () {
@ -121,15 +121,6 @@ class _AppDrawerState extends State<AppDrawer> {
margin: EdgeInsets.symmetric(horizontal: 20), margin: EdgeInsets.symmetric(horizontal: 20),
child: Column( child: Column(
children: [ children: [
InkWell(
child: DrawerItem(
TranslationBase.of(context).logout, Icons.settings),
onTap: () async {
Navigator.pop(context);
await helpers.logout();
projectsProvider.isLogin = false;
},
),
InkWell( InkWell(
child: DrawerItem( child: DrawerItem(
projectsProvider.isArabic projectsProvider.isArabic
@ -143,6 +134,16 @@ class _AppDrawerState extends State<AppDrawer> {
projectsProvider.changeLanguage('ar'); projectsProvider.changeLanguage('ar');
}, },
), ),
InkWell(
child: DrawerItem(
TranslationBase.of(context).logout, DoctorApp.logout_1),
onTap: () async {
Navigator.pop(context);
await helpers.logout();
projectsProvider.isLogin = false;
},
),
], ],
), ),
), ),

@ -37,8 +37,8 @@ class _BottomNavBarState extends State<BottomNavBar> {
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [ children: [
BottomNavigationItem( BottomNavigationItem(
icon: DoctorApp.home_icon, icon: DoctorApp.home_icon_active,
activeIcon: DoctorApp.home_icon_active, activeIcon: DoctorApp.home_active,
changeIndex: _changeIndex, changeIndex: _changeIndex,
index: _index, index: _index,
currentIndex: 0, currentIndex: 0,
@ -46,7 +46,7 @@ class _BottomNavBarState extends State<BottomNavBar> {
), ),
BottomNavigationItem( BottomNavigationItem(
icon: DoctorApp.schedule_icon, icon: DoctorApp.schedule_icon,
activeIcon: DoctorApp.scdedule_icon_active, activeIcon: DoctorApp.scdedule_icon_active_1,
changeIndex: _changeIndex, changeIndex: _changeIndex,
index: _index, index: _index,
currentIndex: 1, currentIndex: 1,
@ -54,7 +54,7 @@ class _BottomNavBarState extends State<BottomNavBar> {
), ),
BottomNavigationItem( BottomNavigationItem(
icon: DoctorApp.qr_code, icon: DoctorApp.qr_code,
activeIcon: DoctorApp.qr_code, activeIcon: DoctorApp.qr_reader_active_1,
changeIndex: _changeIndex, changeIndex: _changeIndex,
index: _index, index: _index,
currentIndex: 2, currentIndex: 2,
@ -62,7 +62,7 @@ class _BottomNavBarState extends State<BottomNavBar> {
), ),
BottomNavigationItem( BottomNavigationItem(
icon: DoctorApp.message_icon, icon: DoctorApp.message_icon,
activeIcon: DoctorApp.message_icon_active, activeIcon: DoctorApp.dr_reply_active_1,
changeIndex: _changeIndex, changeIndex: _changeIndex,
index: _index, index: _index,
currentIndex: 3, currentIndex: 3,

@ -0,0 +1,619 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/custom_validation_error.dart';
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'app_texts_widget.dart';
import 'dialogs/master_key_dailog.dart';
import 'expandable-widget-header-body.dart';
class MasterKeyCheckboxSearchAllergiesWidget extends StatefulWidget {
final SOAPViewModel model;
final Function () addSelectedAllergy;
final Function(MasterKeyModel) removeAllergy;
final Function(MySelectedAllergy mySelectedAllergy) addAllergy;
final bool Function(MasterKeyModel) isServiceSelected;
final MySelectedAllergy Function(MasterKeyModel) getServiceSelectedAllergy;
final List<MasterKeyModel> masterList;
final String buttonName;
final String hintSearchText;
MasterKeyCheckboxSearchAllergiesWidget(
{Key key,
this.model,
this.addSelectedAllergy,
this.removeAllergy,
this.masterList,
this.addAllergy,
this.isServiceSelected,
this.buttonName,
this.hintSearchText,
this.getServiceSelectedAllergy})
: super(key: key);
@override
_MasterKeyCheckboxSearchAllergiesWidgetState createState() =>
_MasterKeyCheckboxSearchAllergiesWidgetState();
}
class _MasterKeyCheckboxSearchAllergiesWidgetState
extends State<MasterKeyCheckboxSearchAllergiesWidget> {
List<MasterKeyModel> items = List();
MasterKeyModel _selectedAllergySeverity;
bool isSubmitted = false;
@override
void initState() {
items.addAll(widget.masterList);
super.initState();
}
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return Container(
child: Column(
children: [
Expanded(
child: Container(
height: MediaQuery.of(context).size.height * 0.62,
child: Center(
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
children: [
TextFields(
hintText: widget.hintSearchText ??
TranslationBase.of(context).selectAllergy,
borderWidth: 0.0,
padding: EdgeInsets.all(20),
borderRadius: 0,
suffixIcon: EvaIcons.search,
onChanged: (value) {
filterSearchResults(value);
},
),
SizedBox(
height: 10,
),
Expanded(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Container(
height: MediaQuery.of(context).size.height * 0.60,
child: ListView.builder(
itemCount: items.length,
itemBuilder: (context, index) {
bool isSelected =
widget.isServiceSelected(items[index]);
MySelectedAllergy mySelectedAllergy;
if (isSelected) {
mySelectedAllergy =
widget.getServiceSelectedAllergy(
items[index]);
}
TextEditingController remarkController =
TextEditingController(
text: isSelected
? mySelectedAllergy.remark
: null);
TextEditingController severityController =
TextEditingController(
text: isSelected
? mySelectedAllergy
.selectedAllergySeverity !=
null
? projectViewModel.isArabic
? mySelectedAllergy
.selectedAllergySeverity
.nameAr
: mySelectedAllergy
.selectedAllergySeverity
.nameEn
: null
: null);
return HeaderBodyExpandableNotifier(
headerWidget: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Checkbox(
value:
widget.isServiceSelected(
items[index]),
activeColor: Colors.red[800],
onChanged: (bool newValue) {
// setState(() {
// if (widget
// .isServiceSelected(items[index])) {
// widget.removeHistory(items[index]);
// } else {
// widget.addHistory(items[index]);
// }
// });
}),
InkWell(
onTap: () {
setState(() {
if (widget
.isServiceSelected(
items[index])) {
widget.removeAllergy(
items[index]);
} else {
// TODO add Allergy
MySelectedAllergy
mySelectedAllergy =
new MySelectedAllergy(
selectedAllergy:
items[index],
selectedAllergySeverity:
_selectedAllergySeverity,
remark: null,
isChecked: true,
isExpanded: true);
widget.addAllergy(
mySelectedAllergy);
}
});
},
child: Expanded(
child: Padding(
padding: const EdgeInsets
.symmetric(
horizontal: 10,
vertical: 0),
child: Container(
child: AppText(
projectViewModel.isArabic
? items[index]
.nameAr !=
""
? items[index]
.nameAr
: items[index]
.nameEn
: items[index].nameEn,
color: Color(0xFF575757),
fontSize: 16,
fontWeight:
FontWeight.w600,
),
width: MediaQuery.of(context).size.width * 0.55,
),
),
),
),
],
),
InkWell(
onTap: () {
if (mySelectedAllergy != null) {
setState(() {
mySelectedAllergy
.isExpanded =
mySelectedAllergy
.isExpanded
? false
: true;
});
}
},
child: Icon((mySelectedAllergy !=
null
? mySelectedAllergy
.isExpanded
: false)
? EvaIcons
.arrowIosUpwardOutline
: EvaIcons
.arrowIosDownwardOutline))
],
),
bodyWidget: Column(
children: [
TextFields(
onTapTextFields: widget.model
.allergySeverityList !=
null
? () {
MasterKeyDailog dialog =
MasterKeyDailog(
list: widget.model
.allergySeverityList,
okText:
TranslationBase.of(
context)
.ok,
okFunction:
(selectedValue) {
setState(() {
mySelectedAllergy
.selectedAllergySeverity =
selectedValue;
});
},
);
showDialog(
barrierDismissible:
false,
context: context,
builder: (BuildContext
context) {
return dialog;
},
);
}
: null,
hasLabelText:
mySelectedAllergy != null &&
mySelectedAllergy
.selectedAllergySeverity !=
null
? true
: false,
showLabelText: true,
hintText:
TranslationBase
.of(context)
.selectSeverity,
fontSize: 13.5,
readOnly: true,
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
maxLines: 2,
minLines: 1,
controller: severityController,
validator: (value) {
if (value == null)
return TranslationBase
.of(
context)
.emptyMessage;
else
return null;
}),
SizedBox(
height: 5,
),
if(isSubmitted &&
mySelectedAllergy
.selectedAllergySeverity == null)
Row(
children: [
CustomValidationError(),
],
mainAxisAlignment: MainAxisAlignment.start,
),
SizedBox(
height: 10,
),
Container(
margin: EdgeInsets.only(
left: 0, right: 0, top: 15),
child: TextFields(
hasLabelText:
remarkController.text !=
''
? true
: false,
showLabelText: true,
hintText: TranslationBase
.of(
context)
.remarks,
fontSize: 13.5,
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
maxLines: 25,
minLines: 10,
initialValue: isSelected
? mySelectedAllergy
.remark : '',
// controller: remarkControlle
onChanged: (value) {
if (isSelected) {
mySelectedAllergy
.remark = value;
};
},
validator: (value) {
if (value == null)
return TranslationBase
.of(
context)
.emptyMessage;
else
return null;
}),
),
SizedBox(
height: 10,
),
],),
isExpand: mySelectedAllergy != null
? mySelectedAllergy.isExpanded
: false,
);
Column(
children: [
InkWell(
onTap: () {
setState(() {
if (widget.isServiceSelected(
items[index])) {
widget
.removeAllergy(
items[index]);
} else {
// TODO add Allergy
MySelectedAllergy
mySelectedAllergy =
new MySelectedAllergy(
selectedAllergy:
items[index],
selectedAllergySeverity:
_selectedAllergySeverity,
remark: null,
isChecked: true);
widget.addAllergy(
mySelectedAllergy);
}
});
},
child: Column(
children: [
Row(
children: [
Checkbox(
value: widget
.isServiceSelected(
items[index]),
activeColor:
Colors.red[800],
onChanged: (bool newValue) {
// setState(() {
// if (widget
// .isServiceSelected(items[index])) {
// widget.removeHistory(items[index]);
// } else {
// widget.addHistory(items[index]);
// }
// });
}),
Expanded(
child: Padding(
padding: const EdgeInsets
.symmetric(
horizontal: 10,
vertical: 0),
child: AppText(
projectViewModel.isArabic
? items[index]
.nameAr !=
""
? items[index]
.nameAr
: items[index]
.nameEn
: items[index].nameEn,
color: Color(0xFF575757),
fontSize: 16,
fontWeight:
FontWeight.w600,
),
),
),
],
),
if(widget
.isServiceSelected(
items[index]))
Column(children: [
TextFields(
onTapTextFields: widget.model
.allergySeverityList !=
null
? () {
MasterKeyDailog dialog =
MasterKeyDailog(
list: widget.model
.allergySeverityList,
okText:
TranslationBase.of(
context)
.ok,
okFunction:
(selectedValue) {
setState(() {
mySelectedAllergy
.selectedAllergySeverity =
selectedValue;
});
},
);
showDialog(
barrierDismissible:
false,
context: context,
builder: (BuildContext
context) {
return dialog;
},
);
}
: null,
hasLabelText:
mySelectedAllergy
.selectedAllergySeverity !=
null
? true
: false,
showLabelText: true,
hintText:
TranslationBase
.of(context)
.selectSeverity,
fontSize: 13.5,
readOnly: true,
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
maxLines: 2,
minLines: 1,
controller: severityController,
validator: (value) {
if (value == null)
return TranslationBase
.of(
context)
.emptyMessage;
else
return null;
}),
SizedBox(
height: 5,
),
if(isSubmitted &&
mySelectedAllergy
.selectedAllergySeverity == null)
Row(
children: [
CustomValidationError(),
],
mainAxisAlignment: MainAxisAlignment.start,
),
SizedBox(
height: 10,
),
Container(
margin: EdgeInsets.only(
left: 0, right: 0, top: 15),
child: TextFields(
hasLabelText:
remarkController.text !=
''
? true
: false,
showLabelText: true,
hintText: TranslationBase
.of(
context)
.remarks,
fontSize: 13.5,
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
maxLines: 25,
minLines: 10,
initialValue: isSelected
? mySelectedAllergy
.remark : '',
// controller: remarkControlle
onChanged: (value) {
if (isSelected) {
mySelectedAllergy
.remark = value;
};
},
validator: (value) {
if (value == null)
return TranslationBase
.of(
context)
.emptyMessage;
else
return null;
}),
),
SizedBox(
height: 10,
),
],)
],
),
),
// DividerWithSpacesAround(),
],
);
},
),
),
),
),
],
)
)),
),
),
SizedBox(
height: 10,
),
if (widget.model.state == ViewState.Idle)
AppButton(
title: "Add Selected Allergy",
padding: 10,
color: Color(0xFF359846),
onPressed: () {
setState(() {
isSubmitted = true;
});
widget.addSelectedAllergy();
},
),
],
),
);
}
void filterSearchResults(String query) {
List<MasterKeyModel> dummySearchList = List();
dummySearchList.addAll(widget.masterList);
if (query.isNotEmpty) {
List<MasterKeyModel> dummyListData = List();
dummySearchList.forEach((items) {
if (items.nameAr.toLowerCase().contains(query.toLowerCase()) ||
items.nameEn.toLowerCase().contains(query.toLowerCase())) {
dummyListData.add(items);
}
});
setState(() {
items.clear();
items.addAll(dummyListData);
});
return;
} else {
setState(() {
items.clear();
items.addAll(widget.masterList);
});
}
}
}
Loading…
Cancel
Save