Merge branch 'development' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into fix-issues

merge-requests/440/head
hussam al-habibeh 5 years ago
commit 9adf55710e

@ -68,6 +68,7 @@ class BaseAppClient {
body['LanguageID'] = 2; body['LanguageID'] = 2;
body['stamp'] = STAMP; body['stamp'] = STAMP;
// if(!body.containsKey("IPAdress"))
body['IPAdress'] = IP_ADDRESS; body['IPAdress'] = IP_ADDRESS;
body['VersionID'] = VERSION_ID; body['VersionID'] = VERSION_ID;
body['Channel'] = CHANNEL; body['Channel'] = CHANNEL;
@ -85,6 +86,9 @@ class BaseAppClient {
print("URL : $url"); print("URL : $url");
print("Body : ${json.encode(body)}"); print("Body : ${json.encode(body)}");
String bodyData= json.encode(body);
var asd="";
if (await Helpers.checkConnection()) { if (await Helpers.checkConnection()) {
final response = await http.post(url, final response = await http.post(url,
@ -148,7 +152,7 @@ class BaseAppClient {
: SETUP_ID; : SETUP_ID;
} }
body['VersionID'] = VERSION_ID; body['VersionID'] = 6.3;
body['Channel'] = CHANNEL; body['Channel'] = CHANNEL;
body['LanguageID'] = languageID == 'ar' ? 1 : 2; body['LanguageID'] = languageID == 'ar' ? 1 : 2;

@ -121,7 +121,7 @@ const GET_DASHBOARD =
const GET_SICKLEAVE_STATISTIC = const GET_SICKLEAVE_STATISTIC =
'Services/DoctorApplication.svc/REST/PreSickLeaveStatistics'; 'Services/DoctorApplication.svc/REST/PreSickLeaveStatistics';
const ARRIVED_PATIENT_URL = const ARRIVED_PATIENT_URL =
'Services/DoctorApplication.svc/REST/PatientArrivalList'; 'Services/DoctorApplication.svc/REST/PatientArrivalList';
const ADD_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/PostSickLeave'; const ADD_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/PostSickLeave';
const GET_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/GetAllSickLeaves'; const GET_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/GetAllSickLeaves';
const EXTEND_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/ExtendSickLeave'; const EXTEND_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/ExtendSickLeave';

@ -1,8 +1,9 @@
class MedicalFileRequestModel { class MedicalFileRequestModel {
int patientMRN; int patientMRN;
String vidaAuthTokenID; String vidaAuthTokenID;
String iPAdress;
MedicalFileRequestModel({this.patientMRN, this.vidaAuthTokenID}); MedicalFileRequestModel({this.patientMRN, this.vidaAuthTokenID,this.iPAdress});
MedicalFileRequestModel.fromJson(Map<String, dynamic> json) { MedicalFileRequestModel.fromJson(Map<String, dynamic> json) {
patientMRN = json['PatientMRN']; patientMRN = json['PatientMRN'];
@ -13,6 +14,7 @@ class MedicalFileRequestModel {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['PatientMRN'] = this.patientMRN; data['PatientMRN'] = this.patientMRN;
data['VidaAuthTokenID'] = this.vidaAuthTokenID; data['VidaAuthTokenID'] = this.vidaAuthTokenID;
data['IPAdress'] = this.iPAdress;
return data; return data;
} }
} }

@ -15,18 +15,18 @@ class InsuranceCardService extends BaseService {
List<InsuranceApprovalModel> get insuranceApproval => _insuranceApproval; List<InsuranceApprovalModel> get insuranceApproval => _insuranceApproval;
Future getInsuranceApproval(PatiantInformtion patient,{int appointmentNo}) async { Future getInsuranceApproval(PatiantInformtion patient,{int appointmentNo , int projectId}) async {
hasError = false; hasError = false;
// _cardList.clear(); // _cardList.clear();
if (appointmentNo != null) { // if (appointmentNo != null) {
_insuranceApprovalModel.appointmentNo = appointmentNo; // _insuranceApprovalModel.appointmentNo = appointmentNo;
_insuranceApprovalModel.eXuldAPPNO = null; // _insuranceApprovalModel.eXuldAPPNO = null;
_insuranceApprovalModel.projectID = null; // _insuranceApprovalModel.projectID = projectId;
} else { // } else {
_insuranceApprovalModel.appointmentNo = null; _insuranceApprovalModel.appointmentNo = null;
_insuranceApprovalModel.eXuldAPPNO = 0; _insuranceApprovalModel.eXuldAPPNO = 0;
_insuranceApprovalModel.projectID = 0; _insuranceApprovalModel.projectID = 0;
} // }
await baseAppClient.postPatient(GET_PAtIENTS_INSURANCE_APPROVALS, await baseAppClient.postPatient(GET_PAtIENTS_INSURANCE_APPROVALS,
patient: patient, patient: patient,

@ -16,6 +16,7 @@ class MedicalFileService extends BaseService {
Future getMedicalFile({int mrn}) async { Future getMedicalFile({int mrn}) async {
_fileRequestModel = MedicalFileRequestModel(patientMRN: mrn); _fileRequestModel = MedicalFileRequestModel(patientMRN: mrn);
_fileRequestModel.iPAdress = "9.9.9.9";
hasError = false; hasError = false;
_medicalFileList.clear(); _medicalFileList.clear();
await baseAppClient.post(GET_MEDICAL_FILE, await baseAppClient.post(GET_MEDICAL_FILE,

@ -14,12 +14,12 @@ class InsuranceViewModel extends BaseViewModel{
List<InsuranceApprovalModel> get insuranceApproval => List<InsuranceApprovalModel> get insuranceApproval =>
_insuranceCardService.insuranceApproval; _insuranceCardService.insuranceApproval;
Future getInsuranceApproval(PatiantInformtion patient,{int appointmentNo}) async { Future getInsuranceApproval(PatiantInformtion patient,{int appointmentNo, int projectId}) async {
error = ""; error = "";
setState(ViewState.Busy); setState(ViewState.Busy);
if (appointmentNo != null) if (appointmentNo != null)
await _insuranceCardService.getInsuranceApproval(patient, await _insuranceCardService.getInsuranceApproval(patient,
appointmentNo: appointmentNo); appointmentNo: appointmentNo,projectId: projectId);
else else
await _insuranceCardService.getInsuranceApproval(patient); await _insuranceCardService.getInsuranceApproval(patient);
if (_insuranceCardService.hasError) { if (_insuranceCardService.hasError) {

@ -43,11 +43,11 @@ class DoctorReplayChat extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
), ),
height: 150, height: 115,
child: Container( child: Container(
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: 10, right: 10, bottom: 10), left: 10, right: 10),
margin: EdgeInsets.only(top: 50), margin: EdgeInsets.only(top: 40),
child: Column( child: Column(
children: [ children: [
Row( Row(
@ -300,31 +300,44 @@ class DoctorReplayChat extends StatelessWidget {
), ),
), ),
bottomSheet: Container( bottomSheet: Container(
child:TextFields( width: double.infinity,
hasLabelText: msgController.text != '' // height: MediaQuery.of(context).size.height * 0.12,
? true child: Column(
: false, mainAxisSize: MainAxisSize.min,
showLabelText: false, children: <Widget>[
hintText: TranslationBase FractionallySizedBox(
.of(context) child: Container(
.typeHereToReply, child: TextFields(
fontSize: 13.5, borderRadius: 0,
suffixIcon: FontAwesomeIcons.arrowRight, hasLabelText: msgController.text != ''
suffixIconColor: Colors.green, ? true
// hintColor: Colors.black, : false,
fontWeight: FontWeight.w600, showLabelText: false,
maxLines: 50, hintText: "\n"+TranslationBase
minLines: 3, .of(context)
controller: msgController, .typeHereToReply,
validator: (value) { fontSize: 13.5,
if (value == null || value == "")
return TranslationBase.of(context) suffixIcon: FontAwesomeIcons.arrowRight,
.emptyMessage; suffixIconColor: Colors.green,
else // hintColor: Colors.black,
return null; fontWeight: FontWeight.w600,
}), maxLines: 50,
height: MediaQuery.of(context).size.height * 0.1, minLines: 3,
), controller: msgController,
validator: (value) {
if (value == null || value == "")
return TranslationBase.of(context)
.emptyMessage;
else
return null;
}),
),
),
],
),
)
)); ));
} }
} }

@ -39,14 +39,15 @@ class DoctorReplyScreen extends StatelessWidget {
children: children:
model.listDoctorWorkingHoursTable.map((reply) { model.listDoctorWorkingHoursTable.map((reply) {
return InkWell( return InkWell(
onTap: () { onTap: () {
Navigator.push( // Navigator.push(
context, // context,
MaterialPageRoute( // MaterialPageRoute(
builder: (BuildContext context) => // builder: (BuildContext context) =>
DoctorReplayChat(reply: reply))); // DoctorReplayChat(reply: reply)));
}, },
child: DoctorReplyWidget(reply: reply)); child: DoctorReplyWidget(reply: reply),
);
}).toList(), }).toList(),
) )
], ],

@ -42,7 +42,7 @@ class _InsuranceApprovalScreenNewState
return BaseView<InsuranceViewModel>( return BaseView<InsuranceViewModel>(
onModelReady: patient.appointmentNo != null onModelReady: patient.appointmentNo != null
? (model) => model.getInsuranceApproval(patient, ? (model) => model.getInsuranceApproval(patient,
appointmentNo: patient.appointmentNo) appointmentNo: patient.appointmentNo,projectId: patient.projectId)
: (model) => model.getInsuranceApproval(patient), : (model) => model.getInsuranceApproval(patient),
builder: (BuildContext context, InsuranceViewModel model, Widget child) => builder: (BuildContext context, InsuranceViewModel model, Widget child) =>
AppScaffold( AppScaffold(
@ -147,7 +147,7 @@ class _InsuranceApprovalScreenNewState
.toString(), .toString(),
isPrescriptions: true, isPrescriptions: true,
approvalStatus: model.insuranceApproval[index] approvalStatus: model.insuranceApproval[index]
.approvalDetails.status, .approvalDetails?.status??'',
), ),
), ),
), ),

@ -37,7 +37,7 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
return BaseView<InsuranceViewModel>( return BaseView<InsuranceViewModel>(
onModelReady: patient.appointmentNo != null onModelReady: patient.appointmentNo != null
? (model) => model.getInsuranceApproval(patient, ? (model) => model.getInsuranceApproval(patient,
appointmentNo: patient.appointmentNo) appointmentNo: patient.appointmentNo,projectId: patient.projectId)
: (model) => model.getInsuranceApproval(patient), : (model) => model.getInsuranceApproval(patient),
builder: (BuildContext context, InsuranceViewModel model, Widget child) => builder: (BuildContext context, InsuranceViewModel model, Widget child) =>
AppScaffold( AppScaffold(
@ -93,14 +93,12 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
Row( Row(
children: [ children: [
Texts( Texts(
model.insuranceApproval[indexInsurance] model.insuranceApproval[indexInsurance].approvalDetails!=null?
.approvalDetails.status, model.insuranceApproval[indexInsurance].approvalDetails.status ??"":"",
color: color:
model.insuranceApproval[indexInsurance] model.insuranceApproval[indexInsurance].approvalDetails!=null?
.approvalDetails.status == "${model.insuranceApproval[indexInsurance].approvalDetails.status}"
"Approved" == "Approved" ? Color(0xff359846) : Color(0xffD02127): Color(0xffD02127),
? Color(0xff359846)
: Color(0xffD02127),
), ),
], ],
), ),
@ -210,9 +208,7 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
Texts('Sample') Texts('Sample')
], ],
), ),
SizedBox(
height: 25.0,
),
Row( Row(
children: [ children: [
Texts( Texts(
@ -315,8 +311,8 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
child: Texts(model child: Texts(model
.insuranceApproval[ .insuranceApproval[
indexInsurance] indexInsurance]
.approvalDetails ?.approvalDetails
.procedureName), ?.procedureName??""),
), ),
Container( Container(
height: MediaQuery.of(context) height: MediaQuery.of(context)
@ -330,8 +326,8 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
child: Texts(model child: Texts(model
.insuranceApproval[ .insuranceApproval[
indexInsurance] indexInsurance]
.approvalDetails ?.approvalDetails
.status), ?.status??""),
), ),
Container( Container(
height: MediaQuery.of(context) height: MediaQuery.of(context)
@ -345,8 +341,8 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
child: Texts(model child: Texts(model
.insuranceApproval[ .insuranceApproval[
indexInsurance] indexInsurance]
.approvalDetails ?.approvalDetails
.isInvoicedDesc), ?.isInvoicedDesc??""),
), ),
], ],
), ),

@ -167,15 +167,23 @@ class _PatientsScreenState extends State<PatientsScreen> {
var strExist = str.length > 0 ? true : false; var strExist = str.length > 0 ? true : false;
if (true) { if (true) {
List<PatiantInformtion> filterDate = []; List<PatiantInformtion> filterDate = [];
String patiantAppointment = "";
for (var i = 0; i < responseModelList2.length; i++) { for (var i = 0; i < responseModelList2.length; i++) {
String patiantAppointment = try {
convertDateFormat(responseModelList[i].appointmentDate); if (responseModelList[i].appointmentDate == "") {
patiantAppointment = responseModelList[i].arrivedOn;
} else {
patiantAppointment =
convertDateFormat(responseModelList[i].appointmentDate);
}
String dateAppointment = checkDate(patiantAppointment); String dateAppointment = checkDate(patiantAppointment);
if (dateAppointment.contains(str)) { if (dateAppointment.contains(str) || str == 'All') {
filterDate.add(responseModelList[i]); filterDate.add(responseModelList[i]);
}
} catch (e) {
print(e);
} }
} }
@ -441,17 +449,18 @@ class _PatientsScreenState extends State<PatientsScreen> {
}, },
)), )),
Padding( Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: MediaQuery.of(context) top: MediaQuery.of(context)
.size .size
.height * .height *
0.03), 0.03),
child: SERVICES_PATIANT2[ child: _locationBar(context)
int.parse(patientType)] == // child: SERVICES_PATIANT2[
"List_MyOutPatient" // int.parse(patientType)] ==
? _locationBar(context) // "List_MyOutPatient"
: Container(), // ? _locationBar(context)
), // : Container(),
),
// Row( // Row(
// mainAxisAlignment: // mainAxisAlignment:
// MainAxisAlignment.spaceEvenly, // MainAxisAlignment.spaceEvenly,

@ -19,7 +19,13 @@ class RadiologyDetailsPage extends StatelessWidget {
final PatiantInformtion patient; final PatiantInformtion patient;
final String patientType; final String patientType;
final String arrivalType; final String arrivalType;
RadiologyDetailsPage({Key key, this.finalRadiology, this.patient, this.patientType, this.arrivalType});
RadiologyDetailsPage(
{Key key,
this.finalRadiology,
this.patient,
this.patientType,
this.arrivalType});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -30,66 +36,72 @@ class RadiologyDetailsPage extends StatelessWidget {
lineItem: finalRadiology.invoiceLineItemNo, lineItem: finalRadiology.invoiceLineItemNo,
invoiceNo: finalRadiology.invoiceNo), invoiceNo: finalRadiology.invoiceNo),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
appBar: PatientProfileHeaderWhitAppointmentAppBar( appBar: PatientProfileHeaderWhitAppointmentAppBar(
patient: patient, patient: patient,
patientType: patientType??"0", patientType: patientType ?? "0",
arrivalType: arrivalType??"0", arrivalType: arrivalType ?? "0",
orderNo: finalRadiology.orderNo.toString(), appointmentDate: finalRadiology.orderDate,
appointmentDate:finalRadiology.orderDate, doctorName: finalRadiology.doctorName,
doctorName: finalRadiology.doctorName, profileUrl: finalRadiology.doctorImageURL,
profileUrl: finalRadiology.doctorImageURL, invoiceNO: finalRadiology.invoiceNo.toString(),
invoiceNO: finalRadiology.invoiceNo.toString(), ),
), isShowAppBar: true,
isShowAppBar: true, baseViewModel: model,
baseViewModel: model, body: SingleChildScrollView(
body: SingleChildScrollView( child: Column(
child: Column( mainAxisSize: MainAxisSize.max,
mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, children: <Widget>[
children: <Widget>[ Container(
Container( margin: EdgeInsets.all(8),
margin: EdgeInsets.all(8), decoration: BoxDecoration(
decoration: BoxDecoration( color: Colors.white,
color: Colors.white, borderRadius: BorderRadius.circular(12),
borderRadius: BorderRadius.circular(12), ),
), child: Column(
child: Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ SizedBox(
SizedBox(height: 5,), height: 5,
Texts(TranslationBase.of(context).generalResult), ),
SizedBox(height: 5,), Texts(TranslationBase.of(context).generalResult),
Padding( SizedBox(
padding: const EdgeInsets.all(8.0), height: 5,
child: Texts( ),
'${finalRadiology.reportData.trim()}', Padding(
textAlign: TextAlign.start, padding: const EdgeInsets.all(8.0),
fontSize: 17, child: Texts(
color: Colors.grey, '${finalRadiology.reportData.trim()}',
), textAlign: TextAlign.start,
fontSize: 17,
color: Colors.grey,
), ),
SizedBox(height: 25,), ),
if(model.radImageURL.isNotEmpty) SizedBox(
Center( height: 100,
child: Container( ),
width: MediaQuery.of(context).size.width * 0.8,
child: Button(
color: Colors.red, ],
onTap: () {
launch(model.radImageURL);
},
title: TranslationBase.of(context).openRad,
),
),
),
],
),
), ),
], ),
), ],
), ),
),
bottomSheet: model.radImageURL.isNotEmpty ?Container(
width: double.maxFinite,
height: 100,
child: Container(
margin: EdgeInsets.only(left: 35,right: 35,top: 12,bottom: 12),
child: Button(
color: Colors.red,
onTap: () {
launch(model.radImageURL);
},
title: TranslationBase.of(context).openRad,
),
), ),
):null,
),
); );
} }
} }

@ -124,7 +124,6 @@ class RadiologyHomePage extends StatelessWidget {
invoiceNO: '${model.radiologyList[index].invoiceNo}', invoiceNO: '${model.radiologyList[index].invoiceNo}',
branch: '${model.radiologyList[index].projectName}', branch: '${model.radiologyList[index].projectName}',
appointmentDate: model.radiologyList[index].orderDate, appointmentDate: model.radiologyList[index].orderDate,
orderNo: model.radiologyList[index].orderNo.toString(),
), ),
)), )),

@ -115,16 +115,30 @@ class LineChartCurved extends StatelessWidget {
//rotateAngle:-65, //rotateAngle:-65,
margin: 22, margin: 22,
getTitles: (value) { getTitles: (value) {
if (timeSeries.length > value.toInt()) { if (timeSeries.length < 15) {
DateTime dateTime = timeSeries[value.toInt()].time; if (timeSeries.length > value.toInt()) {
if (isDatesSameYear) { DateTime dateTime = timeSeries[value.toInt()].time;
return monthFormat.format(dateTime); if (isDatesSameYear) {
return monthFormat.format(dateTime);
} else {
return yearFormat.format(dateTime);
}
} else { } else {
return yearFormat.format(dateTime); return '';
} }
} else { } else {
return ''; if (value.toInt() == 0 ||
value.toInt() == timeSeries.length - 1 ||
xAxixs.contains(value.toInt())) {
DateTime dateTime = timeSeries[value.toInt()].time;
if (isDatesSameYear) {
return monthFormat.format(dateTime);
} else {
return yearFormat.format(dateTime);
}
}
} }
/*if (timeSeries.length < 15) { /*if (timeSeries.length < 15) {
if (timeSeries.length > value.toInt()) { if (timeSeries.length > value.toInt()) {
DateTime dateTime = timeSeries[value.toInt()].time; DateTime dateTime = timeSeries[value.toInt()].time;
@ -232,7 +246,7 @@ class LineChartCurved extends StatelessWidget {
final LineChartBarData lineChartBarData1 = LineChartBarData( final LineChartBarData lineChartBarData1 = LineChartBarData(
spots: spots, spots: spots,
isCurved: true, isCurved: true,
colors: [Colors.red]/*[Theme.of(context).primaryColor]*/, colors: [Colors.red] /*[Theme.of(context).primaryColor]*/,
barWidth: 5, barWidth: 5,
isStrokeCapRound: true, isStrokeCapRound: true,
dotData: FlDotData( dotData: FlDotData(

@ -100,13 +100,25 @@ class PrescriptionItemsPage extends StatelessWidget {
Row( Row(
children: [ children: [
Texts(TranslationBase.of(context).route,color: Colors.grey,), Texts(TranslationBase.of(context).route,color: Colors.grey,),
Expanded(child: Texts(model.prescriptionReportList[index].routeN)), Expanded(child: Texts(" "+model.prescriptionReportList[index].routeN)),
], ],
), ),
Row( Row(
children: [ children: [
Texts(TranslationBase.of(context).frequency,color: Colors.grey,), Texts(TranslationBase.of(context).frequency,color: Colors.grey,),
Texts(model.prescriptionReportList[index].frequencyN ?? ''), Texts(" "+model.prescriptionReportList[index].frequencyN ?? ''),
],
),
Row(
children: [
Texts(TranslationBase.of(context).dailyDoses,color: Colors.grey,),
Texts(" "+model.prescriptionReportList[index].doseDailyQuantity ?? ''),
],
),
Row(
children: [
Texts(TranslationBase.of(context).duration,color: Colors.grey,),
Texts(" "+model.prescriptionReportList[index].days.toString() ?? ''),
], ],
), ),
SizedBox(height: 12,), SizedBox(height: 12,),
@ -178,13 +190,25 @@ class PrescriptionItemsPage extends StatelessWidget {
Row( Row(
children: [ children: [
Texts(TranslationBase.of(context).route,color: Colors.grey,), Texts(TranslationBase.of(context).route,color: Colors.grey,),
Expanded(child: Texts(model.prescriptionReportEnhList[index].route??'')), Expanded(child: Texts(" "+model.prescriptionReportEnhList[index].route??'')),
], ],
), ),
Row( Row(
children: [ children: [
Texts(TranslationBase.of(context).frequency,color: Colors.grey,), Texts(TranslationBase.of(context).frequency,color: Colors.grey,),
Texts(model.prescriptionReportEnhList[index].frequency ?? ''), Texts(" "+model.prescriptionReportEnhList[index].frequency ?? ''),
],
),
Row(
children: [
Texts(TranslationBase.of(context).dailyDoses,color: Colors.grey,),
Texts(" "+model.prescriptionReportEnhList[index].doseDailyQuantity.toString() ?? ''),
],
),
Row(
children: [
Texts(TranslationBase.of(context).duration,color: Colors.grey,),
Texts(" "+model.prescriptionReportList[index].days.toString() ?? ''),
], ],
), ),
SizedBox(height: 12,), SizedBox(height: 12,),

@ -21,31 +21,32 @@ class MyScheduleWidget extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Column( Expanded(
mainAxisAlignment: MainAxisAlignment.start, child: Column(
crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ crossAxisAlignment: CrossAxisAlignment.start,
SizedBox( children: [
height: 10, SizedBox(
), height: 10,
AppText( ),
workingHoursTable.dayName, AppText(
fontSize: 2.5 * SizeConfig.textMultiplier, workingHoursTable.dayName,
fontFamily: 'Poppins', fontSize: 18,
// fontSize: 18 fontFamily: 'Poppins',
), // fontSize: 18
SizedBox( ),
height: 10, SizedBox(
), height: 10,
AppText( ),
' ${workingHoursTable.date.day} ${(DateUtils.getMonth(workingHoursTable.date.month).toString().substring(0, 3))}', AppText(
fontSize: 2.5 * SizeConfig.textMultiplier, ' ${workingHoursTable.date.day} ${(DateUtils.getMonth(workingHoursTable.date.month).toString().substring(0, 3))}',
fontWeight: FontWeight.w700, fontSize: 18,
fontWeight: FontWeight.w700,
fontFamily: 'Poppins', fontFamily: 'Poppins',
// fontSize: 18 // fontSize: 18
), ),
], ],
),
), ),
Container( Container(
width: MediaQuery.of(context).size.width * 0.55, width: MediaQuery.of(context).size.width * 0.55,
@ -80,15 +81,10 @@ class MyScheduleWidget extends StatelessWidget {
), ),
Container( Container(
width: MediaQuery.of(context).size.width*0.55, width: MediaQuery.of(context).size.width*0.55,
child: Expanded( child: AppText(
child: Padding( '${work.from} - ${work.to}',
padding: const EdgeInsets.all(8.0), fontSize: 15,
child: AppText( fontWeight: FontWeight.w300,
work.from + ' - ' + work.to,
fontSize: 15,
fontWeight: FontWeight.w300,
),
),
), ),
) )
], ],

@ -20,59 +20,65 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return PreferredSize( int gender = 1;
preferredSize: Size(double.infinity, 200), if (patient.patientDetails != null) {
gender = patient.patientDetails.gender;
} else {
gender = patient.gender;
}
return Container(
padding: EdgeInsets.only(
left: 0, right: 5, bottom: 5,),
decoration: BoxDecoration(
color: Colors.white,
),
height: 200,
child: Container( child: Container(
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: 0, right: 5, bottom: 5,), left: 10, right: 10, bottom: 10),
decoration: BoxDecoration( margin: EdgeInsets.only(top: 50),
color: Colors.white, child: Column(
), children: [
height: 200, Container(
child: Container( padding: EdgeInsets.only(left: 12.0),
padding: EdgeInsets.only( child: Row(children: [
left: 10, right: 10, bottom: 10), IconButton(
margin: EdgeInsets.only(top: 50), icon: Icon(Icons.arrow_back_ios),
child: Column( color: Colors.black, //Colors.black,
children: [ onPressed: () => Navigator.pop(context),
Container( ),
padding: EdgeInsets.only(left: 12.0), Expanded(
child: Row(children: [ child: AppText(
IconButton(
icon: Icon(Icons.arrow_back_ios),
color: Colors.black, //Colors.black,
onPressed: () => Navigator.pop(context),
),
AppText(
patient.firstName != null ? patient.firstName != null ?
(Helpers.capitalize(patient.firstName) + (Helpers.capitalize(patient.firstName) +
" " + " " +
Helpers.capitalize( Helpers.capitalize(
patient.lastName)) : Helpers.capitalize(patient.patientDetails.fullName), patient.lastName)) : Helpers.capitalize(patient.patientDetails.fullName),
fontSize: SizeConfig.textMultiplier * 2.5, fontSize: SizeConfig.textMultiplier *2.2,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
backGroundcolor: Colors.white, backGroundcolor: Colors.white,
fontFamily: 'Poppins', fontFamily: 'Poppins',
), ),
patient.gender == 1 ),
? Icon( gender == 1
DoctorApp.male_2, ? Icon(
color: Colors.blue, DoctorApp.male_2,
) color: Colors.blue,
: Icon( )
DoctorApp.female_1, : Icon(
color: Colors.pink, DoctorApp.female_1,
), color: Colors.pink,
]), ),
), ]),
Row(children: [ ),
Padding( Row(children: [
padding: EdgeInsets.only(left: 12.0), Padding(
child: Container( padding: EdgeInsets.only(left: 12.0),
width: 60, child: Container(
height: 60, width: 60,
child: Image.asset( height: 60,
patient.gender == 1 child: Image.asset(
gender == 1
? 'assets/images/male_avatar.png' ? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png', : 'assets/images/female_avatar.png',
fit: BoxFit.cover, fit: BoxFit.cover,
@ -134,182 +140,179 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred
FontWeight.w600, FontWeight.w600,
) )
: AppText( : AppText(
DateUtils.convertStringToDateFormat( patient.arrivedOn!=null? DateUtils.convertStringToDateFormat(
patient patient.arrivedOn,
.arrivedOn, 'MM-dd-yyyy HH:mm'):'',
'MM-dd-yyyy HH:mm'), fontFamily:
fontFamily: 'Poppins',
'Poppins', fontWeight:
fontWeight: FontWeight.w600,
FontWeight.w600, )
) ],
], ))
)) : SizedBox(),
: SizedBox(), if (SERVICES_PATIANT2[
if (SERVICES_PATIANT2[ int.parse(patientType)] ==
int.parse(patientType)] == "List_MyOutPatient")
"List_MyOutPatient") Container(
Container( child: Row(
child: Row( mainAxisAlignment:
mainAxisAlignment: MainAxisAlignment.start,
MainAxisAlignment.start, children: <Widget>[
children: <Widget>[ AppText(
AppText( TranslationBase.of(context)
TranslationBase.of(context) .appointmentDate +
.appointmentDate + " : ",
" : ", fontSize: 14,
fontSize: 14, ),
), patient.startTime != null
patient.startTime != null ? Container(
? Container( height: 15,
height: 15, width: 60,
width: 60, decoration:
decoration: BoxDecoration(
BoxDecoration( borderRadius:
borderRadius: BorderRadius
BorderRadius .circular(
.circular( 25),
25), color: HexColor(
color: HexColor( "#20A169"),
"#20A169"),
),
child: AppText(
patient.startTime,
color: Colors.white,
fontSize: 1.5 *
SizeConfig
.textMultiplier,
textAlign: TextAlign
.center,
fontWeight:
FontWeight.bold,
),
)
: SizedBox(),
SizedBox(
width: 3.5,
), ),
Container( child: AppText(
child: AppText( patient.startTime,
convertDateFormat2(patient.appointmentDate.toString()?? ''), color: Colors.white,
fontSize: 1.5 * fontSize: 1.5 *
SizeConfig SizeConfig
.textMultiplier, .textMultiplier,
fontWeight: textAlign: TextAlign
FontWeight.bold, .center,
), fontWeight:
FontWeight.bold,
), ),
SizedBox( )
height: 0.5, : SizedBox(),
) SizedBox(
], width: 3.5,
),
margin: EdgeInsets.only(
top: 8,
),
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
RichText(
text: TextSpan(
style: TextStyle(
fontSize: 1.6 *
SizeConfig
.textMultiplier,
color: Colors.black),
children: <TextSpan>[
new TextSpan(
text:
TranslationBase.of(
context)
.fileNumber,
style: TextStyle(
fontSize: 12,
fontFamily:
'Poppins')),
new TextSpan(
text: patient.patientId
.toString(),
style: TextStyle(
fontWeight:
FontWeight.w700,
fontFamily:
'Poppins',
fontSize: 14)),
],
), ),
), Container(
Row( child: AppText(
children: [ convertDateFormat2(patient.appointmentDate.toString()?? ''),
AppText( fontSize: 1.5 *
patient.nationalityName ?? SizeConfig
patient.nationality, .textMultiplier,
fontWeight: FontWeight.bold, fontWeight:
fontSize: 12, FontWeight.bold,
), ),
patient.nationality != null
? ClipRRect(
borderRadius:
BorderRadius
.circular(
20.0),
child: Image.network(
patient
.nationalityFlagURL,
height: 25,
width: 30,
errorBuilder:
(BuildContext
context,
Object
exception,
StackTrace
stackTrace) {
return Text(
'No Image');
},
))
: SizedBox()
],
)
],
),
Container(
child: RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: 1.6 *
SizeConfig.textMultiplier,
color: Colors.black,
fontFamily: 'Poppins',
), ),
SizedBox(
height: 0.5,
)
],
),
margin: EdgeInsets.only(
top: 8,
),
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
RichText(
text: TextSpan(
style: TextStyle(
fontSize: 1.6 *
SizeConfig
.textMultiplier,
color: Colors.black),
children: <TextSpan>[ children: <TextSpan>[
new TextSpan( new TextSpan(
text: TranslationBase.of( text:
TranslationBase.of(
context) context)
.age + .fileNumber,
" : ",
style: TextStyle( style: TextStyle(
fontSize: 14)), fontSize: 12,
fontFamily:
'Poppins')),
new TextSpan( new TextSpan(
text: text: patient.patientId
"${DateUtils.getAgeByBirthday(patient.dateofBirth, context)}", .toString(),
style: TextStyle( style: TextStyle(
fontWeight: fontWeight:
FontWeight.w700, FontWeight.w700,
fontFamily:
'Poppins',
fontSize: 14)), fontSize: 14)),
], ],
), ),
), ),
Row(
children: [
AppText(
patient.nationalityName ??
patient.nationality,
fontWeight: FontWeight.bold,
fontSize: 12,
),
patient.nationality != null
? ClipRRect(
borderRadius:
BorderRadius
.circular(
20.0),
child: Image.network(
patient.nationalityFlagURL,
height: 25,
width: 30,
errorBuilder:
(BuildContext
context,
Object
exception,
StackTrace
stackTrace) {
return Text(
'No Image');
},
))
: SizedBox()
],
)
],
),
Container(
child: RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: 1.6 *
SizeConfig.textMultiplier,
color: Colors.black,
fontFamily: 'Poppins',
),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(
context)
.age +
" : ",
style: TextStyle(
fontSize: 14)),
new TextSpan(
text:
"${DateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth : patient.dateofBirth, context)}",
style: TextStyle(
fontWeight:
FontWeight.w700,
fontSize: 14)),
],
),
), ),
], ),
), ],
), ),
]), ),
], ]),
), ],
), ),
), ),
); );

@ -11,25 +11,34 @@ import 'package:hexcolor/hexcolor.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
class PatientProfileHeaderNewDesign extends StatelessWidget { class PatientProfileHeaderNewDesign extends StatelessWidget {
final PatiantInformtion patient; final PatiantInformtion patient;
final String patientType; final String patientType;
final String arrivalType; final String arrivalType;
PatientProfileHeaderNewDesign(this.patient, this.patientType, this.arrivalType); PatientProfileHeaderNewDesign(
this.patient, this.patientType, this.arrivalType);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
int gender = 1;
if (patient.patientDetails != null) {
gender = patient.patientDetails.gender;
} else {
gender = patient.gender;
}
return Container( return Container(
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: 0, right: 5, bottom: 5,), left: 0,
right: 5,
bottom: 5,
),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
), ),
height: 200, height: 200,
child: Container( child: Container(
padding: EdgeInsets.only( padding: EdgeInsets.only(left: 10, right: 10, bottom: 10),
left: 10, right: 10, bottom: 10),
margin: EdgeInsets.only(top: 50), margin: EdgeInsets.only(top: 50),
child: Column( child: Column(
children: [ children: [
@ -43,26 +52,26 @@ class PatientProfileHeaderNewDesign extends StatelessWidget {
), ),
Expanded( Expanded(
child: AppText( child: AppText(
patient.firstName != null ? patient.firstName != null
(Helpers.capitalize(patient.firstName) + ? (Helpers.capitalize(patient.firstName) +
" " + " " +
Helpers.capitalize( Helpers.capitalize(patient.lastName))
patient.lastName)) : Helpers.capitalize(patient.patientDetails.fullName), : Helpers.capitalize(patient.patientDetails.fullName),
fontSize: SizeConfig.textMultiplier *2.5, fontSize: SizeConfig.textMultiplier * 2.2,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
backGroundcolor: Colors.white, backGroundcolor: Colors.white,
fontFamily: 'Poppins', fontFamily: 'Poppins',
), ),
), ),
patient.gender == 1 gender == 1
? Icon( ? Icon(
DoctorApp.male_2, DoctorApp.male_2,
color: Colors.blue, color: Colors.blue,
) )
: Icon( : Icon(
DoctorApp.female_1, DoctorApp.female_1,
color: Colors.pink, color: Colors.pink,
), ),
]), ]),
), ),
Row(children: [ Row(children: [
@ -72,7 +81,7 @@ class PatientProfileHeaderNewDesign extends StatelessWidget {
width: 60, width: 60,
height: 60, height: 60,
child: Image.asset( child: Image.asset(
patient.gender == 1 gender == 1
? 'assets/images/male_avatar.png' ? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png', : 'assets/images/female_avatar.png',
fit: BoxFit.cover, fit: BoxFit.cover,
@ -84,119 +93,84 @@ class PatientProfileHeaderNewDesign extends StatelessWidget {
), ),
Expanded( Expanded(
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
SERVICES_PATIANT2[ SERVICES_PATIANT2[int.parse(patientType)] ==
int.parse(patientType)] == "patientArrivalList"
"patientArrivalList"
? Container( ? Container(
child: Row( child: Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment children: [
.spaceBetween, patient.patientStatusType == 43
children: [ ? AppText(
patient.patientStatusType == TranslationBase.of(context).arrivedP,
43 color: Colors.green,
? AppText( fontWeight: FontWeight.bold,
TranslationBase.of( fontFamily: 'Poppins',
context) fontSize: 12,
.arrivedP, )
color: Colors.green, : AppText(
fontWeight: TranslationBase.of(context).notArrived,
FontWeight.bold, color: Colors.red[800],
fontFamily: fontWeight: FontWeight.bold,
'Poppins', fontFamily: 'Poppins',
fontSize: 12, fontSize: 12,
) ),
: AppText( arrivalType == '1'
TranslationBase.of( ? AppText(
context) patient.startTime != null
.notArrived, ? patient.startTime
color: : '',
Colors.red[800], fontFamily: 'Poppins',
fontWeight: fontWeight: FontWeight.w600,
FontWeight.bold, )
fontFamily: : AppText(
'Poppins', DateUtils.convertStringToDateFormat(
fontSize: 12, patient.arrivedOn,
), 'MM-dd-yyyy HH:mm'),
arrivalType == '1' fontFamily: 'Poppins',
? AppText( fontWeight: FontWeight.w600,
patient.startTime != )
null ],
? patient ))
.startTime
: '',
fontFamily:
'Poppins',
fontWeight:
FontWeight.w600,
)
: AppText(
DateUtils.convertStringToDateFormat(
patient
.arrivedOn,
'MM-dd-yyyy HH:mm'),
fontFamily:
'Poppins',
fontWeight:
FontWeight.w600,
)
],
))
: SizedBox(), : SizedBox(),
if (SERVICES_PATIANT2[ if (SERVICES_PATIANT2[int.parse(patientType)] ==
int.parse(patientType)] ==
"List_MyOutPatient") "List_MyOutPatient")
Container( Container(
child: Row( child: Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.start,
MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
AppText( AppText(
TranslationBase.of(context) TranslationBase.of(context).appointmentDate +
.appointmentDate +
" : ", " : ",
fontSize: 14, fontSize: 14,
), ),
patient.startTime != null patient.startTime != null
? Container( ? Container(
height: 15, height: 15,
width: 60, width: 60,
decoration: decoration: BoxDecoration(
BoxDecoration( borderRadius: BorderRadius.circular(25),
borderRadius: color: HexColor("#20A169"),
BorderRadius ),
.circular( child: AppText(
25), patient.startTime,
color: HexColor( color: Colors.white,
"#20A169"), fontSize: 1.5 * SizeConfig.textMultiplier,
), textAlign: TextAlign.center,
child: AppText( fontWeight: FontWeight.bold,
patient.startTime, ),
color: Colors.white, )
fontSize: 1.5 *
SizeConfig
.textMultiplier,
textAlign: TextAlign
.center,
fontWeight:
FontWeight.bold,
),
)
: SizedBox(), : SizedBox(),
SizedBox( SizedBox(
width: 3.5, width: 3.5,
), ),
Container( Container(
child: AppText( child: AppText(
convertDateFormat2(patient.appointmentDate.toString()?? ''), convertDateFormat2(
fontSize: 1.5 * patient.appointmentDate.toString() ?? ''),
SizeConfig fontSize: 1.5 * SizeConfig.textMultiplier,
.textMultiplier, fontWeight: FontWeight.bold,
fontWeight:
FontWeight.bold,
), ),
), ),
SizedBox( SizedBox(
@ -209,34 +183,23 @@ class PatientProfileHeaderNewDesign extends StatelessWidget {
), ),
), ),
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween,
children: [ children: [
RichText( RichText(
text: TextSpan( text: TextSpan(
style: TextStyle( style: TextStyle(
fontSize: 1.6 * fontSize: 1.6 * SizeConfig.textMultiplier,
SizeConfig
.textMultiplier,
color: Colors.black), color: Colors.black),
children: <TextSpan>[ children: <TextSpan>[
new TextSpan( new TextSpan(
text: text: TranslationBase.of(context).fileNumber,
TranslationBase.of(
context)
.fileNumber,
style: TextStyle( style: TextStyle(
fontSize: 12, fontSize: 12, fontFamily: 'Poppins')),
fontFamily:
'Poppins')),
new TextSpan( new TextSpan(
text: patient.patientId text: patient.patientId.toString(),
.toString(),
style: TextStyle( style: TextStyle(
fontWeight: fontWeight: FontWeight.w700,
FontWeight.w700, fontFamily: 'Poppins',
fontFamily:
'Poppins',
fontSize: 14)), fontSize: 14)),
], ],
), ),
@ -244,33 +207,23 @@ class PatientProfileHeaderNewDesign extends StatelessWidget {
Row( Row(
children: [ children: [
AppText( AppText(
patient.nationalityName ?? patient.nationalityName ?? patient.nationality,
patient.nationality,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 12, fontSize: 12,
), ),
patient.nationality != null patient.nationality != null
? ClipRRect( ? ClipRRect(
borderRadius: borderRadius: BorderRadius.circular(20.0),
BorderRadius child: Image.network(
.circular( patient.nationalityFlagURL,
20.0), height: 25,
child: Image.network( width: 30,
patient errorBuilder: (BuildContext context,
.nationalityFlagURL, Object exception,
height: 25, StackTrace stackTrace) {
width: 30, return Text('No Image');
errorBuilder: },
(BuildContext ))
context,
Object
exception,
StackTrace
stackTrace) {
return Text(
'No Image');
},
))
: SizedBox() : SizedBox()
], ],
) )
@ -280,26 +233,19 @@ class PatientProfileHeaderNewDesign extends StatelessWidget {
child: RichText( child: RichText(
text: new TextSpan( text: new TextSpan(
style: new TextStyle( style: new TextStyle(
fontSize: 1.6 * fontSize: 1.6 * SizeConfig.textMultiplier,
SizeConfig.textMultiplier,
color: Colors.black, color: Colors.black,
fontFamily: 'Poppins', fontFamily: 'Poppins',
), ),
children: <TextSpan>[ children: <TextSpan>[
new TextSpan( new TextSpan(
text: TranslationBase.of( text: TranslationBase.of(context).age + " : ",
context) style: TextStyle(fontSize: 14)),
.age +
" : ",
style: TextStyle(
fontSize: 14)),
new TextSpan( new TextSpan(
text: text:
"${DateUtils.getAgeByBirthday(patient.dateofBirth, context)}", "${DateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth : patient.dateofBirth, context)}",
style: TextStyle( style: TextStyle(
fontWeight: fontWeight: FontWeight.w700, fontSize: 14)),
FontWeight.w700,
fontSize: 14)),
], ],
), ),
), ),
@ -326,10 +272,10 @@ class PatientProfileHeaderNewDesign extends StatelessWidget {
var date = new DateTime.fromMillisecondsSinceEpoch( var date = new DateTime.fromMillisecondsSinceEpoch(
int.parse(str.substring(startIndex + start.length, endIndex))); int.parse(str.substring(startIndex + start.length, endIndex)));
newDate = date.year.toString() + newDate = date.year.toString() +
"/" + "/" +
date.month.toString().padLeft(2, '0') + date.month.toString().padLeft(2, '0') +
"/" + "/" +
date.day.toString().padLeft(2, '0'); date.day.toString().padLeft(2, '0');
} }
return newDate.toString(); return newDate.toString();

@ -41,6 +41,13 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
int gender = 1;
if (patient.patientDetails != null) {
gender = patient.patientDetails.gender;
} else {
gender = patient.gender;
}
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return Container( return Container(
padding: EdgeInsets.only( padding: EdgeInsets.only(
@ -63,17 +70,20 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget {
color: Colors.black, //Colors.black, color: Colors.black, //Colors.black,
onPressed: () => Navigator.pop(context), onPressed: () => Navigator.pop(context),
), ),
AppText( Expanded(
(Helpers.capitalize(patient.firstName) + child: AppText(
" " + patient.firstName != null ?
Helpers.capitalize( (Helpers.capitalize(patient.firstName) +
patient.lastName)), " " +
fontSize: SizeConfig.textMultiplier * 3, Helpers.capitalize(
fontWeight: FontWeight.bold, patient.lastName)) : Helpers.capitalize(patient.patientDetails.fullName),
backGroundcolor: Colors.white, fontSize: SizeConfig.textMultiplier *2.2,
fontFamily: 'Poppins', fontWeight: FontWeight.bold,
backGroundcolor: Colors.white,
fontFamily: 'Poppins',
),
), ),
patient.gender == 1 gender == 1
? Icon( ? Icon(
DoctorApp.male_2, DoctorApp.male_2,
color: Colors.blue, color: Colors.blue,
@ -91,7 +101,7 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget {
width: 60, width: 60,
height: 60, height: 60,
child: Image.asset( child: Image.asset(
patient.gender == 1 gender == 1
? 'assets/images/male_avatar.png' ? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png', : 'assets/images/female_avatar.png',
fit: BoxFit.cover, fit: BoxFit.cover,
@ -210,7 +220,7 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget {
), ),
Container( Container(
child: AppText( child: AppText(
convertDateFormat2(patient.appointmentDate??''), convertDateFormat2(patient.appointmentDate.toString()?? ''),
fontSize: 1.5 * fontSize: 1.5 *
SizeConfig SizeConfig
.textMultiplier, .textMultiplier,
@ -275,8 +285,7 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget {
.circular( .circular(
20.0), 20.0),
child: Image.network( child: Image.network(
patient patient.nationalityFlagURL,
.nationalityFlagURL,
height: 25, height: 25,
width: 30, width: 30,
errorBuilder: errorBuilder:
@ -314,7 +323,7 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget {
fontSize: 14)), fontSize: 14)),
new TextSpan( new TextSpan(
text: text:
"${DateUtils.getAgeByBirthday(patient.dateofBirth, context)}", "${DateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth : patient.dateofBirth, context)}",
style: TextStyle( style: TextStyle(
fontWeight: fontWeight:
FontWeight.w700, FontWeight.w700,

@ -42,6 +42,13 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget with Pre
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
int gender = 1;
if (patient.patientDetails != null) {
gender = patient.patientDetails.gender;
} else {
gender = patient.gender;
}
return Container( return Container(
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: 0, right: 5, bottom: 5, top: 5), left: 0, right: 5, bottom: 5, top: 5),
@ -63,18 +70,20 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget with Pre
color: Colors.black, //Colors.black, color: Colors.black, //Colors.black,
onPressed: () => Navigator.pop(context), onPressed: () => Navigator.pop(context),
), ),
AppText( Expanded(
patient.firstName != null ? child: AppText(
(Helpers.capitalize(patient.firstName) + patient.firstName != null ?
" " + (Helpers.capitalize(patient.firstName) +
Helpers.capitalize( " " +
patient.lastName)) : Helpers.capitalize(patient.patientDetails.fullName), Helpers.capitalize(
fontSize: SizeConfig.textMultiplier * 2.5, patient.lastName)) : Helpers.capitalize(patient.patientDetails.fullName),
fontWeight: FontWeight.bold, fontSize: SizeConfig.textMultiplier *2.2,
backGroundcolor: Colors.white, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', backGroundcolor: Colors.white,
fontFamily: 'Poppins',
),
), ),
patient.gender == 1 gender == 1
? Icon( ? Icon(
DoctorApp.male_2, DoctorApp.male_2,
color: Colors.blue, color: Colors.blue,
@ -92,7 +101,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget with Pre
width: 60, width: 60,
height: 60, height: 60,
child: Image.asset( child: Image.asset(
patient.gender == 1 gender == 1
? 'assets/images/male_avatar.png' ? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png', : 'assets/images/female_avatar.png',
fit: BoxFit.cover, fit: BoxFit.cover,
@ -211,7 +220,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget with Pre
), ),
Container( Container(
child: AppText( child: AppText(
convertDateFormat2(patient.appointmentDate??''), convertDateFormat2(patient.appointmentDate.toString()?? ''),
fontSize: 1.5 * fontSize: 1.5 *
SizeConfig SizeConfig
.textMultiplier, .textMultiplier,
@ -276,8 +285,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget with Pre
.circular( .circular(
20.0), 20.0),
child: Image.network( child: Image.network(
patient patient.nationalityFlagURL,
.nationalityFlagURL,
height: 25, height: 25,
width: 30, width: 30,
errorBuilder: errorBuilder:
@ -315,7 +323,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget with Pre
fontSize: 14)), fontSize: 14)),
new TextSpan( new TextSpan(
text: text:
"${DateUtils.getAgeByBirthday(patient.dateofBirth, context)}", "${DateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth : patient.dateofBirth, context)}",
style: TextStyle( style: TextStyle(
fontWeight: fontWeight:
FontWeight.w700, FontWeight.w700,

@ -38,7 +38,7 @@ class ExpandableSOAPWidget extends StatelessWidget {
Texts(headerTitle, Texts(headerTitle,
variant: isExpanded ? "bodyText" : '', variant: isExpanded ? "bodyText" : '',
bold: isExpanded ? true : false, bold: isExpanded ? true : false,
fontSize: 20, fontSize: 15,
color: Colors.black), color: Colors.black),
Icon( Icon(
FontAwesomeIcons.asterisk, FontAwesomeIcons.asterisk,

@ -32,7 +32,7 @@ class StepsWidget extends StatelessWidget {
), ),
), ),
Positioned( Positioned(
top: 45, top: 50,
left: 0, left: 0,
child: InkWell( child: InkWell(
onTap: () => changeCurrentTab(0), onTap: () => changeCurrentTab(0),
@ -40,8 +40,8 @@ class StepsWidget extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
width: 50, width: 38,
height:50, height: 38,
decoration: BoxDecoration( decoration: BoxDecoration(
border: index == 0 border: index == 0
? Border.all(color: Color(0xFFCC9B14), width: 2) ? Border.all(color: Color(0xFFCC9B14), width: 2)
@ -57,7 +57,7 @@ class StepsWidget extends StatelessWidget {
: Color(0xFFCCCCCC), : Color(0xFFCCCCCC),
), ),
child: Center( child: Center(
child: Icon(FontAwesomeIcons.check, size: 25, child: Icon(FontAwesomeIcons.check, size: 20,
color: Colors.white,) color: Colors.white,)
), ),
), ),
@ -70,7 +70,7 @@ class StepsWidget extends StatelessWidget {
AppText( AppText(
"Subjective", "Subjective",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 14, fontSize: 12,
), ),
StatusLabel(selectedStepId: index, stepId: 0,), StatusLabel(selectedStepId: index, stepId: 0,),
@ -81,7 +81,7 @@ class StepsWidget extends StatelessWidget {
), ),
), ),
Positioned( Positioned(
top: 45, top: 50,
left: MediaQuery left: MediaQuery
.of(context) .of(context)
.size .size
@ -92,8 +92,8 @@ class StepsWidget extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Container( Container(
width: 50, width: 38,
height: 50, height: 38,
decoration: BoxDecoration( decoration: BoxDecoration(
border: index == 1 border: index == 1
? Border.all(color: Color(0xFFCC9B14), width: 2) ? Border.all(color: Color(0xFFCC9B14), width: 2)
@ -109,7 +109,7 @@ class StepsWidget extends StatelessWidget {
: Color(0xFFCCCCCC), : Color(0xFFCCCCCC),
), ),
child: Center( child: Center(
child: Icon(FontAwesomeIcons.check, size: 25, child: Icon(FontAwesomeIcons.check, size: 20,
color: Colors.white,) color: Colors.white,)
), ),
), ),
@ -122,7 +122,7 @@ class StepsWidget extends StatelessWidget {
AppText( AppText(
"Objective", "Objective",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 14, fontSize: 12,
), ),
StatusLabel(selectedStepId: index, stepId: 1,), StatusLabel(selectedStepId: index, stepId: 1,),
@ -134,7 +134,7 @@ class StepsWidget extends StatelessWidget {
), ),
), ),
Positioned( Positioned(
top: 45, top: 50,
left: MediaQuery left: MediaQuery
.of(context) .of(context)
.size .size
@ -148,8 +148,8 @@ class StepsWidget extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Container( Container(
width:50, width: 38,
height:50, height: 38,
decoration: BoxDecoration( decoration: BoxDecoration(
border: index == 2 border: index == 2
? Border.all(color: Color(0xFFCC9B14), width: 2) ? Border.all(color: Color(0xFFCC9B14), width: 2)
@ -165,7 +165,7 @@ class StepsWidget extends StatelessWidget {
: Color(0xFFCCCCCC), : Color(0xFFCCCCCC),
), ),
child: Center( child: Center(
child: Icon(FontAwesomeIcons.check, size: 25, child: Icon(FontAwesomeIcons.check, size: 20,
color: Colors.white,) color: Colors.white,)
), ),
), ),
@ -178,7 +178,7 @@ class StepsWidget extends StatelessWidget {
AppText( AppText(
"Assessment", "Assessment",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 14, fontSize: 12,
), ),
StatusLabel(selectedStepId: index, stepId: 2,), StatusLabel(selectedStepId: index, stepId: 2,),
], ],
@ -188,16 +188,16 @@ class StepsWidget extends StatelessWidget {
), ),
), ),
Positioned( Positioned(
top: 45, top: 50,
right: 0, right: 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:50, width: 38,
height:50, height: 38,
decoration: BoxDecoration( decoration: BoxDecoration(
border: index == 3 border: index == 3
? Border.all(color: Color(0xFFCC9B14), width: 2) ? Border.all(color: Color(0xFFCC9B14), width: 2)
@ -213,7 +213,7 @@ class StepsWidget extends StatelessWidget {
: Color(0xFFCCCCCC), : Color(0xFFCCCCCC),
), ),
child: Center( child: Center(
child: Icon(FontAwesomeIcons.check, size: 25, child: Icon(FontAwesomeIcons.check, size: 20,
color: Colors.white,) color: Colors.white,)
), ),
), ),
@ -222,12 +222,13 @@ class StepsWidget extends StatelessWidget {
), ),
Center( Center(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
AppText( AppText(
"Plan", "Plan",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
textAlign: TextAlign.center, textAlign: TextAlign.center,
fontSize: 14, fontSize: 12,
), ),
StatusLabel(selectedStepId: index, stepId: 3,), StatusLabel(selectedStepId: index, stepId: 3,),
], ],
@ -257,7 +258,7 @@ class StepsWidget extends StatelessWidget {
), ),
), ),
Positioned( Positioned(
top: 45, top: 50,
right: 0, right: 0,
child: InkWell( child: InkWell(
onTap: () => changeCurrentTab(0), onTap: () => changeCurrentTab(0),
@ -265,8 +266,8 @@ class StepsWidget extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
width: 50, width: 38,
height:50, height: 38,
decoration: BoxDecoration( decoration: BoxDecoration(
border: index == 0 border: index == 0
? Border.all(color: Color(0xFFCC9B14), width: 2) ? Border.all(color: Color(0xFFCC9B14), width: 2)
@ -282,7 +283,7 @@ class StepsWidget extends StatelessWidget {
: Color(0xFFCCCCCC), : Color(0xFFCCCCCC),
), ),
child: Center( child: Center(
child: Icon(FontAwesomeIcons.check, size: 25, child: Icon(FontAwesomeIcons.check, size: 20,
color: Colors.white,) color: Colors.white,)
), ),
), ),
@ -299,7 +300,7 @@ class StepsWidget extends StatelessWidget {
), ),
), ),
Positioned( Positioned(
top: 45, top: 50,
right: MediaQuery right: MediaQuery
.of(context) .of(context)
.size .size
@ -310,8 +311,8 @@ class StepsWidget extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Container( Container(
width: 50, width: 38,
height: 50, height: 38,
decoration: BoxDecoration( decoration: BoxDecoration(
border: index == 1 border: index == 1
? Border.all(color: Color(0xFFCC9B14), width: 2) ? Border.all(color: Color(0xFFCC9B14), width: 2)
@ -327,7 +328,7 @@ class StepsWidget extends StatelessWidget {
: Color(0xFFCCCCCC), : Color(0xFFCCCCCC),
), ),
child: Center( child: Center(
child: Icon(FontAwesomeIcons.check, size: 25, child: Icon(FontAwesomeIcons.check, size: 20,
color: Colors.white,) color: Colors.white,)
), ),
), ),
@ -355,8 +356,8 @@ class StepsWidget extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Container( Container(
width:50, width: 38,
height:50, height: 38,
decoration: BoxDecoration( decoration: BoxDecoration(
border: index == 2 border: index == 2
? Border.all(color: Color(0xFFCC9B14), width: 2) ? Border.all(color: Color(0xFFCC9B14), width: 2)
@ -372,7 +373,7 @@ class StepsWidget extends StatelessWidget {
: Color(0xFFCCCCCC), : Color(0xFFCCCCCC),
), ),
child: Center( child: Center(
child: Icon(FontAwesomeIcons.check, size: 25, child: Icon(FontAwesomeIcons.check, size: 20,
color: Colors.white,) color: Colors.white,)
), ),
), ),
@ -393,7 +394,7 @@ class StepsWidget extends StatelessWidget {
), ),
), ),
Positioned( Positioned(
top: 45, top: 50,
left: 0, left: 0,
child: InkWell( child: InkWell(
onTap: () => index >= 3 ? changeCurrentTab(4) : null, onTap: () => index >= 3 ? changeCurrentTab(4) : null,
@ -401,8 +402,8 @@ class StepsWidget extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Container( Container(
width:50, width: 38,
height:50, height: 38,
decoration: BoxDecoration( decoration: BoxDecoration(
border: index == 3 border: index == 3
? Border.all(color: Color(0xFFCC9B14), width: 2) ? Border.all(color: Color(0xFFCC9B14), width: 2)
@ -418,7 +419,7 @@ class StepsWidget extends StatelessWidget {
: Color(0xFFCCCCCC), : Color(0xFFCCCCCC),
), ),
child: Center( child: Center(
child: Icon(FontAwesomeIcons.check, size: 25, child: Icon(FontAwesomeIcons.check, size: 20,
color: Colors.white,) color: Colors.white,)
), ),
), ),
@ -453,7 +454,8 @@ class StatusLabel extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
padding: EdgeInsets.symmetric(horizontal: 5, vertical: 3), width: 65,
padding: EdgeInsets.symmetric(horizontal: 2, vertical: 3),
decoration: BoxDecoration( decoration: BoxDecoration(
color: stepId == selectedStepId ? Color(0xFFF1E9D3) : stepId < color: stepId == selectedStepId ? Color(0xFFF1E9D3) : stepId <
selectedStepId ? Color(0xFFD8E8DB) : Color(0xFFCCCCCC), selectedStepId ? Color(0xFFD8E8DB) : Color(0xFFCCCCCC),

@ -1,10 +1,10 @@
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/patients/profile/soap_update/subjective/update_medication_widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_medication_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/new_text_Field.dart'; import 'package:doctor_app_flutter/widgets/shared/new_text_Field.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import '../custom_validation_error.dart';
class UpdateChiefComplaints extends StatelessWidget { class UpdateChiefComplaints extends StatelessWidget {
const UpdateChiefComplaints({ const UpdateChiefComplaints({
@ -13,137 +13,110 @@ class UpdateChiefComplaints extends StatelessWidget {
@required this.complaintsController, @required this.complaintsController,
@required this.illnessController, @required this.illnessController,
@required this.medicationController, @required this.medicationController,
this.complaintsControllerError,
this.illnessControllerError,
this.medicationControllerError,
}) : super(key: key); }) : super(key: key);
final GlobalKey<FormState> formKey; final GlobalKey<FormState> formKey;
final TextEditingController complaintsController; final TextEditingController complaintsController;
final TextEditingController illnessController; final TextEditingController illnessController;
final TextEditingController medicationController; final TextEditingController medicationController;
final String complaintsControllerError;
final String illnessControllerError;
final String medicationControllerError;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Form( return Form(
key: formKey, key: formKey,
child: Column(children: [ child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
SizedBox( SizedBox(
height: 20, height: 20,
), ),
//TODO handel error cases
NewTextFields(
hintText: TranslationBase.of(context).addChiefComplaints,
controller: complaintsController,
maxLines: 25,
minLines: 3,
),
Container( Container(
child: CustomValidationError(
error: complaintsControllerError,
)),
decoration: BoxDecoration( // Container(
color: Colors.white, // margin:
borderRadius: BorderRadius.all( // EdgeInsets.only(left: 10, right: 10, top: 15),
Radius.circular(10.0), // 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(
height: 20,
), ),
border: Border.all(
color: HexColor('#707070'), NewTextFields(
width: 0.30),
),
child: NewTextFields(
hintText: TranslationBase.of(context).addChiefComplaints,
controller: complaintsController,
),
),
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(
height: 20,
),
Container(
margin:
EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields(
hasLabelText:
illnessController.text != '' ? true : false,
showLabelText: true,
hintText: TranslationBase hintText: TranslationBase
.of(context) .of(context)
.historyOfPresentIllness, .historyOfPresentIllness,
fontSize: 13.5,
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
maxLines: 25,
minLines: 13,
controller: illnessController, controller: illnessController,
validator: (value) { maxLines: 25,
if (value == null || value == "") minLines: 3,
return TranslationBase.of(context) ),
.emptyMessage; Container(
else child: CustomValidationError(error: illnessControllerError,)),
return null; SizedBox(
}), height: 20,
), ),
SizedBox( SizedBox(
height: 20, height: 10,
), ),
SizedBox( UpdateMedicationWidget(
height: 10, medicationController: medicationController,
), ),
UpdateMedicationWidget( SizedBox(
medicationController: medicationController, height: 10,
), ),
SizedBox( NewTextFields(
height: 10,
),
Container(
margin:
EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields(
hasLabelText: medicationController.text != ''
? true
: false,
showLabelText: true,
hintText: TranslationBase hintText: TranslationBase
.of(context) .of(context)
.currentMedications, .currentMedications,
fontSize: 13.5,
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
maxLines: 23,
minLines: 10,
controller: medicationController, controller: medicationController,
validator: (value) { maxLines: 25,
if (value == null || value == "") minLines: 3,
return TranslationBase ),
.of(context) Container(child: CustomValidationError(
.emptyMessage; error: medicationControllerError,)),
else SizedBox(
return null; height: 10,
}), ),
), ]),
SizedBox(
height: 10,
),
]),
); );
} }
} }

@ -16,6 +16,7 @@ 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/dialogs/master_key_dailog.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:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../custom_validation_error.dart'; import '../custom_validation_error.dart';
@ -40,17 +41,19 @@ class _UpdateMedicationWidgetState extends State<UpdateMedicationWidget> {
return Column( return Column(
children: [ children: [
Container( Container(
margin: EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields( child: TextFields(
hintText: TranslationBase.of(context).addMedication, hintText: TranslationBase.of(context).addMedication,
borderColor: HexColor('#707070'),
borderWidth: 0.30,
fontSize: 13.5, fontSize: 13.5,
borderRadius: 12,
onTapTextFields: () { onTapTextFields: () {
openMedicationList(context); openMedicationList(context);
}, },
readOnly: true, readOnly: true,
// hintColor: Colors.black, // hintColor: Colors.black,
suffixIcon: EvaIcons.plusCircleOutline, suffixIcon: EvaIcons.plusCircleOutline,
suffixIconColor: AppGlobal.appPrimaryColor, suffixIconColor: Color(0xFF2B353E),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
// controller: messageController, // controller: messageController,
validator: (value) { validator: (value) {

@ -19,8 +19,6 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_Chief_complaints.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_Chief_complaints.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_history_widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_history_widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_medication_widget.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_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/material.dart'; import 'package:flutter/material.dart';
@ -53,7 +51,9 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
TextEditingController illnessController = TextEditingController(); TextEditingController illnessController = TextEditingController();
TextEditingController complaintsController = TextEditingController(); TextEditingController complaintsController = TextEditingController();
TextEditingController medicationController = TextEditingController(); TextEditingController medicationController = TextEditingController();
String complaintsControllerError = '';
String medicationControllerError = '';
String illnessControllerError = '';
final formKey = GlobalKey<FormState>(); final formKey = GlobalKey<FormState>();
getHistory(SOAPViewModel model) async { getHistory(SOAPViewModel model) async {
@ -235,16 +235,23 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
height: 30, height: 30,
), ),
ExpandableSOAPWidget( ExpandableSOAPWidget(
headerTitle: TranslationBase headerTitle: TranslationBase.of(context)
.of(context)
.chiefComplaints .chiefComplaints
.toUpperCase(), ,
onTap: () { onTap: () {
setState(() { setState(() {
isChiefExpand = !isChiefExpand; isChiefExpand = !isChiefExpand;
}); });
}, },
child: UpdateChiefComplaints(formKey: formKey, complaintsController: complaintsController, illnessController: illnessController, medicationController: medicationController), child: UpdateChiefComplaints(
formKey: formKey,
complaintsController: complaintsController,
illnessController: illnessController,
medicationController: medicationController,
complaintsControllerError: complaintsControllerError,
illnessControllerError: illnessControllerError,
medicationControllerError: medicationControllerError,
),
isExpanded: isChiefExpand, isExpanded: isChiefExpand,
), ),
SizedBox( SizedBox(
@ -255,8 +262,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
ExpandableSOAPWidget( ExpandableSOAPWidget(
headerTitle: TranslationBase headerTitle: TranslationBase
.of(context) .of(context)
.histories .histories,
.toUpperCase(),
onTap: () { onTap: () {
setState(() { setState(() {
isHistoryExpand = !isHistoryExpand; isHistoryExpand = !isHistoryExpand;
@ -278,7 +284,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
headerTitle: TranslationBase headerTitle: TranslationBase
.of(context) .of(context)
.allergiesSoap .allergiesSoap
.toUpperCase(), ,
onTap: () { onTap: () {
setState(() { setState(() {
isAllergiesExpand = !isAllergiesExpand; isAllergiesExpand = !isAllergiesExpand;
@ -356,7 +362,9 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
formKey.currentState.save(); formKey.currentState.save();
formKey.currentState.validate(); formKey.currentState.validate();
complaintsControllerError = '';
medicationControllerError = '';
illnessControllerError = '';
if (complaintsController.text.isNotEmpty && if (complaintsController.text.isNotEmpty &&
illnessController.text.isNotEmpty && illnessController.text.isNotEmpty &&
complaintsController.text.length > 25) { complaintsController.text.length > 25) {
@ -382,6 +390,29 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
widget.changePageViewIndex(1); widget.changePageViewIndex(1);
} else { } else {
setState(() {
if (complaintsController.text.isEmpty) {
complaintsControllerError = TranslationBase
.of(context)
.emptyMessage;
} else if (complaintsController.text.length < 25) {
complaintsControllerError = TranslationBase
.of(context)
.chiefComplaintLength;
}
if (illnessController.text.isEmpty) {
illnessControllerError = TranslationBase
.of(context)
.emptyMessage;
}
if (medicationController.text.isEmpty) {
medicationControllerError = TranslationBase
.of(context)
.emptyMessage;
}
});
helpers.showErrorToast(TranslationBase helpers.showErrorToast(TranslationBase
.of(context) .of(context)
.chiefComplaintErrorMsg); .chiefComplaintErrorMsg);

@ -1,5 +1,6 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.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/enum/viewstate.dart'; 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/SOAP_view_model.dart';
@ -13,6 +14,7 @@ import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; 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/patients/profile/soap_update/expandable_SOAP_widget.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_buttons_widget.dart';
@ -25,6 +27,7 @@ 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:provider/provider.dart'; import 'package:provider/provider.dart';
class UpdateObjectivePage extends StatefulWidget { class UpdateObjectivePage extends StatefulWidget {
@ -33,8 +36,13 @@ class UpdateObjectivePage extends StatefulWidget {
final List<MySelectedExamination> mySelectedExamination; final List<MySelectedExamination> mySelectedExamination;
final PatiantInformtion patientInfo; final PatiantInformtion patientInfo;
UpdateObjectivePage( UpdateObjectivePage(
{Key key, this.changePageViewIndex, this.mySelectedExamination, this.patientInfo, this.changeLoadingState}); {Key key,
this.changePageViewIndex,
this.mySelectedExamination,
this.patientInfo,
this.changeLoadingState});
@override @override
_UpdateObjectivePageState createState() => _UpdateObjectivePageState(); _UpdateObjectivePageState createState() => _UpdateObjectivePageState();
@ -55,6 +63,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
)), )),
); );
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size; final screenSize = MediaQuery.of(context).size;
@ -97,350 +106,435 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: false, isShowAppBar: false,
// baseViewModel: model, // baseViewModel: model,
body: Column(
body: SingleChildScrollView( mainAxisAlignment: MainAxisAlignment.spaceBetween,
physics: ScrollPhysics(), children: [
child: Center( Expanded(
child: FractionallySizedBox( child: SingleChildScrollView(
widthFactor: 0.9, physics: ScrollPhysics(),
child: Column( child: Container(
mainAxisAlignment: MainAxisAlignment.start, color: Color.fromRGBO(248, 248, 248, 1),
children: [ child: Center(
SizedBox( child: FractionallySizedBox(
height: 30, widthFactor: 0.95,
), child: Container(
HeaderBodyExpandableNotifier( margin: EdgeInsets.all(8.0),
headerWidget: Row( padding: EdgeInsets.all(12.0),
mainAxisAlignment: MainAxisAlignment.spaceBetween, decoration: BoxDecoration(
children: [ shape: BoxShape.rectangle,
Row( color: Colors.white,
children: [ borderRadius: BorderRadius.circular(12),
Texts(TranslationBase.of(context).physicalSystemExamination, border: Border.fromBorderSide(BorderSide(
variant: isSysExaminationExpand color: Colors.grey.shade400,
? "bodyText" width: 0.4,
: '', )),
bold: isSysExaminationExpand ? true : false,
color: Colors.black),
Icon(
FontAwesomeIcons.asterisk,
color: AppGlobal.appPrimaryColor,
size: 12,
)
],
), ),
InkWell( child: Column(
onTap: () { mainAxisAlignment: MainAxisAlignment.start,
setState(() { children: [
isSysExaminationExpand = HeaderBodyExpandableNotifier(
!isSysExaminationExpand; headerWidget: Row(
}); mainAxisAlignment:
}, MainAxisAlignment.spaceBetween,
child: Icon(isSysExaminationExpand children: [
? EvaIcons.minus Row(
: EvaIcons.plus)) children: [
], AppText(
), "${TranslationBase.of(context).physicalSystemExamination}",
bodyWidget: Column(children: [ fontFamily: 'Poppins',
SizedBox( fontSize: SizeConfig.textMultiplier * 2.0,
height: 20, fontWeight: isSysExaminationExpand ? FontWeight.w700 : FontWeight.normal,
), ),
Column( /*Texts(
children: [ TranslationBase.of(context)
Container( .physicalSystemExamination,
margin: variant: isSysExaminationExpand
EdgeInsets.only(left: 10, right: 10, top: 15), ? "bodyText"
child: TextFields( : '',
hintText: TranslationBase.of(context).physicalSystemExamination, bold: isSysExaminationExpand
fontSize: 13.5, ? true
onTapTextFields: () { : false,
openExaminationList(context); color: Colors.black),*/
}, Icon(
readOnly: true, FontAwesomeIcons.asterisk,
// hintColor: Colors.black, color: AppGlobal.appPrimaryColor,
suffixIcon: EvaIcons.plusCircleOutline, size: 12,
suffixIconColor: AppGlobal.appPrimaryColor, )
fontWeight: FontWeight.w600, ],
// controller: messageController, ),
validator: (value) { InkWell(
if (value == null) onTap: () {
return TranslationBase.of(context) setState(() {
.emptyMessage; isSysExaminationExpand =
else !isSysExaminationExpand;
return null; });
}), },
), child: Icon(isSysExaminationExpand
SizedBox( ? Icons.keyboard_arrow_up
height: 20, : Icons.keyboard_arrow_down))
), ],
Column( ),
children: bodyWidget: Column(children: [
widget.mySelectedExamination.map((examination) {
TextEditingController remarksController= TextEditingController(text :examination.remark);
return Container(
margin: EdgeInsets.only(
left: 15, right: 15, top: 15),
child: Column(children: [
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Texts(
( examination
.selectedExamination.nameEn )
.toUpperCase(),
variant: "bodyText",
bold: true,
color: Colors.black)
],
),
SizedBox( SizedBox(
height: 8, height: 20,
), ),
Row( Column(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [ children: [
Row( Container(
children: [ margin: EdgeInsets.only(
InkWell( left: 10, right: 10, top: 15),
child: Center( child: TextFields(
child: Container( hintText: TranslationBase.of(context)
height: .physicalSystemExamination,
screenSize.height * fontSize: 13.5,
0.070, onTapTextFields: () {
decoration: openExaminationList(context);
containerBorderDecoration( },
examination readOnly: true,
.isNormal // hintColor: Colors.black,
? Color( suffixIcon:
0xFF515A5D) EvaIcons.plusCircleOutline,
: Colors suffixIconColor:
.white, AppGlobal.appPrimaryColor,
Colors.grey), fontWeight: FontWeight.w600,
child: Center( // controller: messageController,
child: Padding( validator: (value) {
padding: if (value == null)
const EdgeInsets return TranslationBase.of(context)
.all(8.0), .emptyMessage;
child: Text( else
TranslationBase.of(context).normal, return null;
style: TextStyle( }),
fontSize: 12, ),
color: SizedBox(
examination height: 20,
.isNormal ),
? Colors.white Column(
: Colors children: widget.mySelectedExamination
.black, .map((examination) {
//Colors.black, TextEditingController
fontWeight: remarksController =
FontWeight TextEditingController(
.bold, text: examination.remark);
),
), return Container(
), margin: EdgeInsets.only(
)), left: 15, right: 15, top: 15),
), child: Column(children: [
onTap: () { Row(
setState(() { mainAxisAlignment:
examination.isAbnormal = MainAxisAlignment
false; .spaceBetween,
examination.isNormal = children: [
true; Texts(
examination.notExamined = false; (examination
}); .selectedExamination
}), .nameEn)
SizedBox( .toUpperCase(),
width: 12, variant: "bodyText",
), bold: true,
InkWell( color: Colors.black)
child: Center( ],
child: Container( ),
height: SizedBox(
screenSize.height * height: 8,
0.070, ),
decoration: Row(
containerBorderDecoration( mainAxisAlignment:
examination MainAxisAlignment
.isAbnormal .spaceBetween,
? Color( children: [
0xFF515A5D) Row(
: Colors children: [
.white, InkWell(
Colors.black), child: Center(
child: Center( child: Container(
child: Padding( height: screenSize
padding: .height *
const EdgeInsets 0.070,
.all(8.0), decoration: containerBorderDecoration(
child: Text( examination
TranslationBase.of(context).abnormal, .isNormal
style: TextStyle( ? Color(
fontSize: 12, 0xFF515A5D)
color: : Colors
examination .white,
.isAbnormal Colors
? Colors.white .grey),
: Colors child: Center(
.black, child:
//Colors.black, Padding(
fontWeight: padding:
FontWeight const EdgeInsets.all(
.bold, 8.0),
), child: Text(
TranslationBase.of(
context)
.normal,
style:
TextStyle(
fontSize:
12,
color: examination.isNormal
? Colors.white
: Colors.black,
//Colors.black,
fontWeight:
FontWeight.bold,
),
),
),
)),
),
onTap: () {
setState(() {
examination
.isAbnormal =
false;
examination
.isNormal =
true;
examination
.notExamined =
false;
});
}),
SizedBox(
width: 12,
), ),
), InkWell(
)), child: Center(
), child: Container(
onTap: () { height: screenSize
setState(() { .height *
examination.isNormal = 0.070,
false; decoration: containerBorderDecoration(
examination.isAbnormal = examination
true; .isAbnormal
examination.notExamined = false; ? Color(
}); 0xFF515A5D)
}),SizedBox( : Colors
width: 12, .white,
), Colors
InkWell( .black),
child: Center( child: Center(
child: Container( child:
height: Padding(
screenSize.height * padding:
0.070, const EdgeInsets.all(
decoration: 8.0),
containerBorderDecoration( child: Text(
examination TranslationBase.of(
.notExamined context)
? Color( .abnormal,
0xFF515A5D) style:
: Colors TextStyle(
.white, fontSize:
Colors.black), 12,
child: Center( color: examination.isAbnormal
child: Padding( ? Colors.white
padding: : Colors.black,
const EdgeInsets //Colors.black,
.all(8.0), fontWeight:
child: Text( FontWeight.bold,
"Not Examined", ),
style: TextStyle( ),
fontSize: 12, ),
color: )),
examination ),
.notExamined onTap: () {
? Colors.white setState(() {
: Colors examination
.black, .isNormal =
//Colors.black, false;
fontWeight: examination
FontWeight .isAbnormal =
.bold, true;
), examination
.notExamined =
false;
});
}),
SizedBox(
width: 12,
), ),
InkWell(
child: Center(
child: Container(
height: screenSize
.height *
0.070,
decoration: containerBorderDecoration(
examination
.notExamined
? Color(
0xFF515A5D)
: Colors
.white,
Colors
.black),
child: Center(
child:
Padding(
padding:
const EdgeInsets.all(
8.0),
child: Text(
"Not Examined",
style:
TextStyle(
fontSize:
12,
color: examination.notExamined
? Colors.white
: Colors.black,
//Colors.black,
fontWeight:
FontWeight.bold,
),
),
),
)),
),
onTap: () {
setState(() {
examination
.isAbnormal =
false;
examination
.isNormal =
false;
examination
.notExamined =
true;
});
}),
],
),
InkWell(
child: Icon(
FontAwesomeIcons.trash,
color: Colors.grey,
size: 20,
), ),
)), onTap: () => removeExamination(
), examination
onTap: () { .selectedExamination),
setState(() { )
examination.isAbnormal = ],
false; ),
examination.isNormal = SizedBox(
false; height: 20,
examination.notExamined = true; ),
}); Container(
}), margin: EdgeInsets.only(
], left: 0, right: 0, top: 15),
), child: TextFields(
InkWell( hasLabelText:
remarksController
child: Icon( .text !=
FontAwesomeIcons.trash, ''
color: Colors.grey, ? true
size: 20, : false,
), showLabelText: true,
onTap: () => removeExamination( hintText:
examination.selectedExamination), TranslationBase.of(
context)
.remarks,
fontSize: 13.5,
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
maxLines: 25,
minLines: 4,
controller:
remarksController,
onChanged: (val) {
examination.remark = val;
},
validator: (value) {
if (value == null)
return TranslationBase
.of(context)
.emptyMessage;
else
return null;
}),
),
SizedBox(
height: 20,
),
]));
}).toList(),
) )
], ],
), )
SizedBox( ]),
height: 20, isExpand: isSysExaminationExpand,
), ),
Container( ],
margin: EdgeInsets.only( ),
left: 0, right: 0, top: 15), ),
child: TextFields( ),
hasLabelText: remarksController.text != ''?true:false, ),
showLabelText: true, ),
hintText: TranslationBase.of(context).remarks,
fontSize: 13.5,
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
maxLines: 25,
minLines: 4,
controller: remarksController,
onChanged: (val) {
examination.remark = val;
},
validator: (value) {
if (value == null)
return TranslationBase.of(context)
.emptyMessage;
else
return null;
}),
),
SizedBox(
height: 20,
),
]));
}).toList(),
)
],
)
]),
isExpand: isSysExaminationExpand,
), ),
DividerWithSpacesAround(height: 30,), ),
AppButton( Container(
title: TranslationBase.of(context).next, margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
loading: model.state == ViewState.BusyLocal, child: Row(
onPressed: () async { children: [
await submitUpdateObjectivePage(model); Expanded(
}, child: AppButton(
title: TranslationBase.of(context).previous,
color: HexColor("#EAEAEA"),
fontColor: Colors.black,
onPressed: () {
widget.changePageViewIndex(0);
},
),
),
SizedBox(
width: 10,
), ),
SizedBox( Expanded(
height: 30, child: AppButton(
title: TranslationBase.of(context).next,
loading: model.state == ViewState.BusyLocal,
color: HexColor("#A5A5A5"),
fontColor: HexColor("#5A5A5A"),
fontWeight: FontWeight.bold,
onPressed: () async {
await submitUpdateObjectivePage(model);
},
),
),
],
), ),
], ),
), ],
), )));
),
)));
} }
submitUpdateObjectivePage(SOAPViewModel model) async { submitUpdateObjectivePage(SOAPViewModel model) async {
if (widget.mySelectedExamination.isNotEmpty) {
if(widget.mySelectedExamination.isNotEmpty){
Map profile = await sharedPref.getObj(DOCTOR_PROFILE); Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
PostPhysicalExamRequestModel postPhysicalExamRequestModel = new PostPhysicalExamRequestModel(); PostPhysicalExamRequestModel postPhysicalExamRequestModel =
new PostPhysicalExamRequestModel();
widget.mySelectedExamination.forEach((exam) { widget.mySelectedExamination.forEach((exam) {
if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM ==
null) null)
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = []; postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM =
[];
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM.add( postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM
ListHisProgNotePhysicalExaminationVM( .add(ListHisProgNotePhysicalExaminationVM(
patientMRN: widget.patientInfo.patientMRN, patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo, episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo, appointmentNo: widget.patientInfo.appointmentNo,
remarks: exam.remark ?? '', remarks: exam.remark ?? '',
createdBy: exam.createdBy??doctorProfile.doctorID, createdBy: exam.createdBy ?? doctorProfile.doctorID,
createdOn: DateTime.now().toIso8601String(), createdOn: DateTime.now().toIso8601String(),
editedBy: doctorProfile.doctorID, editedBy: doctorProfile.doctorID,
editedOn: DateTime.now().toIso8601String(), editedOn: DateTime.now().toIso8601String(),
@ -450,15 +544,20 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
isNormal: exam.isNormal, isNormal: exam.isNormal,
// masterDescription: exam.selectedExamination, // masterDescription: exam.selectedExamination,
notExamined: exam.notExamined, notExamined: exam.notExamined,
examinationType: exam.isNormal?1:exam.isAbnormal?2:3, examinationType: exam.isNormal
examinationTypeName: exam.isNormal?"Normal":exam.isAbnormal?'AbNormal':"Not Examined", ? 1
isNew:exam.isNew : exam.isAbnormal
? 2
)); : 3,
examinationTypeName: exam.isNormal
? "Normal"
: exam.isAbnormal
? 'AbNormal'
: "Not Examined",
isNew: exam.isNew));
}); });
if(model.patientPhysicalExamList.isEmpty) { if (model.patientPhysicalExamList.isEmpty) {
await model.postPhysicalExam(postPhysicalExamRequestModel); await model.postPhysicalExam(postPhysicalExamRequestModel);
} else { } else {
await model.patchPhysicalExam(postPhysicalExamRequestModel); await model.patchPhysicalExam(postPhysicalExamRequestModel);
@ -482,9 +581,8 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
removeExamination(MasterKeyModel masterKey) { removeExamination(MasterKeyModel masterKey) {
Iterable<MySelectedExamination> history = widget.mySelectedExamination Iterable<MySelectedExamination> history = widget.mySelectedExamination
.where( .where((element) =>
(element) => masterKey.id == element.selectedExamination.id &&
masterKey.id == element.selectedExamination.id &&
masterKey.typeId == element.selectedExamination.typeId); masterKey.typeId == element.selectedExamination.typeId);
if (history.length > 0) if (history.length > 0)
@ -494,11 +592,9 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
} }
openExaminationList(BuildContext context) { openExaminationList(BuildContext context) {
final screenSize = MediaQuery final screenSize = MediaQuery.of(context).size;
.of(context) InputDecoration textFieldSelectorDecoration(
.size; String hintText, String selectedText, bool isDropDown) {
InputDecoration textFieldSelectorDecoration(String hintText,
String selectedText, bool isDropDown) {
return InputDecoration( return InputDecoration(
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
@ -533,7 +629,8 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
Navigator.of(context).pop(); Navigator.of(context).pop();
}); });
}, },
removeExamination: (masterKey) => removeExamination(masterKey),); removeExamination: (masterKey) => removeExamination(masterKey),
);
}); });
} }
} }
@ -541,10 +638,13 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
class AddExaminationDailog extends StatefulWidget { class AddExaminationDailog extends StatefulWidget {
final List<MySelectedExamination> mySelectedExamination; final List<MySelectedExamination> mySelectedExamination;
final Function addSelectedExamination; final Function addSelectedExamination;
final Function (MasterKeyModel) removeExamination; final Function(MasterKeyModel) removeExamination;
const AddExaminationDailog( const AddExaminationDailog(
{Key key, this.mySelectedExamination, this.addSelectedExamination, this.removeExamination}) {Key key,
this.mySelectedExamination,
this.addSelectedExamination,
this.removeExamination})
: super(key: key); : super(key: key);
@override @override
@ -559,71 +659,69 @@ class _AddExaminationDailogState extends State<AddExaminationDailog> {
child: BaseView<SOAPViewModel>( child: BaseView<SOAPViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
if (model.physicalExaminationList.length == 0) { if (model.physicalExaminationList.length == 0) {
await model.getMasterLookup( await model
MasterKeysService.PhysicalExamination); .getMasterLookup(MasterKeysService.PhysicalExamination);
} }
}, },
builder: (_, model, w) => builder: (_, model, w) => AppScaffold(
AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: false, isShowAppBar: false,
body: Center( body: Center(
child: Container( child: Container(
child: FractionallySizedBox( child: FractionallySizedBox(
widthFactor: 0.9, widthFactor: 0.9,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox( SizedBox(
height: 16, height: 16,
), ),
AppText( AppText(
TranslationBase.of(context).physicalSystemExamination, TranslationBase.of(context).physicalSystemExamination,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 16, fontSize: 16,
), ),
SizedBox( SizedBox(
height: 16, height: 16,
), ),
MasterKeyCheckboxSearchWidget( MasterKeyCheckboxSearchWidget(
model: model, model: model,
hintSearchText: TranslationBase.of(context).searchExamination, hintSearchText:
buttonName: TranslationBase.of(context).addExamination, TranslationBase.of(context).searchExamination,
masterList: model.physicalExaminationList, buttonName:
removeHistory: (history){ TranslationBase.of(context).addExamination,
setState(() { masterList: model.physicalExaminationList,
widget.removeExamination(history); removeHistory: (history) {
}); setState(() {
}, widget.removeExamination(history);
addHistory: (history){ });
setState(() { },
MySelectedExamination mySelectedExamination = new MySelectedExamination( addHistory: (history) {
selectedExamination: history setState(() {
); MySelectedExamination mySelectedExamination =
widget new MySelectedExamination(
.mySelectedExamination selectedExamination: history);
.add( widget.mySelectedExamination
mySelectedExamination); .add(mySelectedExamination);
}); });
}, },
addSelectedHistories: (){ addSelectedHistories: () {
widget.addSelectedExamination(); widget.addSelectedExamination();
}, },
isServiceSelected: (master) =>isServiceSelected(master), isServiceSelected: (master) =>
), isServiceSelected(master),
]), ),
))), ]),
))),
)), )),
); );
} }
isServiceSelected(MasterKeyModel masterKey) { isServiceSelected(MasterKeyModel masterKey) {
Iterable<MySelectedExamination> exam = Iterable<MySelectedExamination> exam = widget.mySelectedExamination.where(
widget (element) =>
.mySelectedExamination masterKey.id == element.selectedExamination.id &&
.where((element) => masterKey.typeId == element.selectedExamination.typeId);
masterKey.id == element.selectedExamination.id &&
masterKey.typeId == element.selectedExamination.typeId);
if (exam.length > 0) { if (exam.length > 0) {
return true; return true;
} }

@ -77,7 +77,7 @@ class TextFields extends StatefulWidget {
this.hasBorder = true, this.hasBorder = true,
this.onTapTextFields, this.onTapTextFields,
this.hasLabelText = false, this.hasLabelText = false,
this.showLabelText = false}) this.showLabelText = false, this.borderRadius= 8.0, this.borderColor, this.borderWidth = 1, })
: super(key: key); : super(key: key);
final String hintText; final String hintText;
@ -116,6 +116,9 @@ class TextFields extends StatefulWidget {
final Color fillColor; final Color fillColor;
final bool hasBorder; final bool hasBorder;
final bool showLabelText; final bool showLabelText;
Color borderColor;
final double borderRadius;
final double borderWidth;
bool hasLabelText; bool hasLabelText;
@override @override
@ -200,6 +203,8 @@ class _TextFieldsState extends State<TextFields> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
widget.borderColor = widget.borderColor?? Colors.grey;
return (AnimatedContainer( return (AnimatedContainer(
duration: Duration(milliseconds: 300), duration: Duration(milliseconds: 300),
decoration: widget.bare decoration: widget.bare
@ -276,6 +281,7 @@ class _TextFieldsState extends State<TextFields> {
hintText: widget.hintText, hintText: widget.hintText,
hintStyle: TextStyle( hintStyle: TextStyle(
fontSize: widget.fontSize, fontSize: widget.fontSize,
fontWeight: widget.fontWeight, fontWeight: widget.fontWeight,
color: widget.hintColor ?? Theme.of(context).hintColor, color: widget.hintColor ?? Theme.of(context).hintColor,
), ),
@ -304,7 +310,7 @@ class _TextFieldsState extends State<TextFields> {
width: 1.0) width: 1.0)
: BorderSide(color: Colors.transparent, width: 0), : BorderSide(color: Colors.transparent, width: 0),
borderRadius: widget.hasBorder borderRadius: widget.hasBorder
? BorderRadius.circular(widget.bare ? 0.0 : 8.0) ? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius)
: BorderRadius.circular(0.0), : BorderRadius.circular(0.0),
), ),
focusedErrorBorder: OutlineInputBorder( focusedErrorBorder: OutlineInputBorder(
@ -315,28 +321,28 @@ class _TextFieldsState extends State<TextFields> {
.withOpacity(widget.bare ? 0.0 : 0.5), .withOpacity(widget.bare ? 0.0 : 0.5),
width: 1.0) width: 1.0)
: BorderSide(color: Colors.transparent, width: 0), : BorderSide(color: Colors.transparent, width: 0),
borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0)), borderRadius: BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius)),
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderSide: widget.hasBorder borderSide: widget.hasBorder
? BorderSide(color: Colors.grey, width: 1.0) ? BorderSide(color: widget.borderColor,width: widget.borderWidth)
: BorderSide(color: Colors.transparent, width: 0), : BorderSide(color: Colors.transparent, width: 0),
borderRadius: widget.hasBorder borderRadius: widget.hasBorder
? BorderRadius.circular(widget.bare ? 0.0 : 8.0) ? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius)
: BorderRadius.circular(0.0), : BorderRadius.circular(0.0),
), ),
disabledBorder: OutlineInputBorder( disabledBorder: OutlineInputBorder(
borderSide: widget.hasBorder borderSide: widget.hasBorder
? BorderSide(color: Colors.grey, width: 1.0) ? BorderSide(color: widget.borderColor,width: widget.borderWidth)
: BorderSide(color: Colors.transparent, width: 0), : BorderSide(color: Colors.transparent, width: 0),
borderRadius: widget.hasBorder borderRadius: widget.hasBorder
? BorderRadius.circular(widget.bare ? 0.0 : 8.0) ? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius)
: BorderRadius.circular(0.0)), : BorderRadius.circular(0.0)),
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderSide: widget.hasBorder borderSide: widget.hasBorder
? BorderSide(color: Colors.grey, width: 1.0) ? BorderSide(color: widget.borderColor,width: widget.borderWidth)
: BorderSide(color: Colors.transparent, width: 0), : BorderSide(color: Colors.transparent, width: 0),
borderRadius: widget.hasBorder borderRadius: widget.hasBorder
? BorderRadius.circular(widget.bare ? 0.0 : 8.0) ? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius)
: BorderRadius.circular(0.0), : BorderRadius.circular(0.0),
), ),
), ),

@ -2,6 +2,7 @@ import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:hexcolor/hexcolor.dart';
class NumberTextInputFormatter extends TextInputFormatter { class NumberTextInputFormatter extends TextInputFormatter {
@override @override
@ -70,8 +71,8 @@ class NewTextFields extends StatefulWidget {
this.prefixIcon, this.prefixIcon,
this.bare = false, this.bare = false,
this.onTap, this.onTap,
this.fontSize = 16.0, this.fontSize = 15.0,
this.fontWeight = FontWeight.w700, this.fontWeight = FontWeight.w500,
this.autoValidate = false, this.autoValidate = false,
this.hintColor, this.hintColor,
this.isEnabled = true}) this.isEnabled = true})
@ -158,9 +159,15 @@ class _NewTextFieldsState extends State<NewTextFields> {
duration: Duration(milliseconds: 300), duration: Duration(milliseconds: 300),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
border: Border.all(
color: HexColor('#707070'),
width: 0.30),
color: Colors.white), color: Colors.white),
child: Container( child: Container(
margin: EdgeInsets.only(top: 8), margin: EdgeInsets.only(top: 8),
padding: EdgeInsets.only(top: 8),
child: TextFormField( child: TextFormField(
enabled: widget.isEnabled, enabled: widget.isEnabled,
initialValue: widget.initialValue, initialValue: widget.initialValue,
@ -190,7 +197,7 @@ class _NewTextFieldsState extends State<NewTextFields> {
validator: widget.validator, validator: widget.validator,
onSaved: widget.onSaved, onSaved: widget.onSaved,
style: Theme.of(context).textTheme.body2.copyWith( style: Theme.of(context).textTheme.body2.copyWith(
fontSize: widget.fontSize, fontWeight: widget.fontWeight), fontSize: widget.fontSize, fontWeight: widget.fontWeight, color: Color(0xFF575757), fontFamily: 'Poppins'),
inputFormatters: widget.keyboardType == TextInputType.phone inputFormatters: widget.keyboardType == TextInputType.phone
? <TextInputFormatter>[ ? <TextInputFormatter>[
WhitelistingTextInputFormatter.digitsOnly, WhitelistingTextInputFormatter.digitsOnly,
@ -200,7 +207,7 @@ class _NewTextFieldsState extends State<NewTextFields> {
decoration: InputDecoration( decoration: InputDecoration(
labelText: widget.hintText, labelText: widget.hintText,
labelStyle: labelStyle:
TextStyle(color: Theme.of(context).textTheme.bodyText1.color), TextStyle(color: Color(0xFF2E303A), fontSize:15,fontWeight: FontWeight.w700),
errorBorder: OutlineInputBorder( errorBorder: OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(
color: Theme.of(context).errorColor.withOpacity(0.5), color: Theme.of(context).errorColor.withOpacity(0.5),

Loading…
Cancel
Save