Merge branch 'textfield-validation' into 'development'

referaal design

See merge request Cloud_Solution/doctor_app_flutter!481
merge-requests/482/merge
Mohammad Aljammal 5 years ago
commit 2ca3b643c3

@ -10,19 +10,14 @@ import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.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/patient-referral-item-widget.dart'; import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/profile-welcome-widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/profile_medical_info_widget_search.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/profile_medical_info_widget_search.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/borderedButton.dart'; import 'package:doctor_app_flutter/widgets/shared/borderedButton.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../../../routes.dart';
class MyReferralDetailScreen extends StatelessWidget { class MyReferralDetailScreen extends StatelessWidget {
PendingReferral pendingReferral; PendingReferral pendingReferral;
@ -37,7 +32,7 @@ class MyReferralDetailScreen extends StatelessWidget {
return BaseView<PatientReferralViewModel>( return BaseView<PatientReferralViewModel>(
onModelReady: (model) => model.getPatientDetails( onModelReady: (model) => model.getPatientDetails(
DateUtils.convertStringToDateFormat( DateUtils.convertStringToDateFormat(
DateTime.now()/*.subtract(Duration(days: 350))*/.toString(), DateTime.now() /*.subtract(Duration(days: 350))*/ .toString(),
"yyyy-MM-dd"), "yyyy-MM-dd"),
DateUtils.convertStringToDateFormat( DateUtils.convertStringToDateFormat(
DateTime.now().toString(), "yyyy-MM-dd"), DateTime.now().toString(), "yyyy-MM-dd"),
@ -52,14 +47,13 @@ class MyReferralDetailScreen extends StatelessWidget {
? Column( ? Column(
children: [ children: [
Container( Container(
padding: EdgeInsets.only( padding:
left: 0, right: 5, bottom: 5, top: 5), EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
), ),
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: [
@ -73,14 +67,19 @@ class MyReferralDetailScreen extends StatelessWidget {
), ),
Expanded( Expanded(
child: AppText( child: AppText(
(Helpers.capitalize(model.patientArrivalList[0].patientDetails.fullName)), (Helpers.capitalize(model
.patientArrivalList[0]
.patientDetails
.fullName)),
fontSize: SizeConfig.textMultiplier * 2.5, fontSize: SizeConfig.textMultiplier * 2.5,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
backGroundcolor: Colors.white, backGroundcolor: Colors.white,
fontFamily: 'Poppins', fontFamily: 'Poppins',
), ),
), ),
model.patientArrivalList[0].patientDetails.gender == 1 model.patientArrivalList[0].patientDetails
.gender ==
1
? Icon( ? Icon(
DoctorApp.male_2, DoctorApp.male_2,
color: Colors.blue, color: Colors.blue,
@ -101,18 +100,6 @@ class MyReferralDetailScreen extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
/*ProfileWelcomeWidget(
AppText(
authProvider.selectedClinicName != null
? authProvider.selectedClinicName
: authProvider
.doctorProfile.clinicDescription,
fontSize: SizeConfig.textMultiplier * 1.7,
color: Colors.white,
textAlign: TextAlign.center,
),
height: 100,
),*/
SizedBox( SizedBox(
height: 16, height: 16,
), ),
@ -127,21 +114,31 @@ class MyReferralDetailScreen extends StatelessWidget {
), ),
), ),
PatientReferralItemWidget( PatientReferralItemWidget(
"${pendingReferral.patientID}",
patientName: pendingReferral.patientName,
referralStatus: pendingReferral.referralStatus, referralStatus: pendingReferral.referralStatus,
isReferredTo: false, patientName: pendingReferral.patientName,
patientGender:
pendingReferral.patientDetails.gender,
referredDate:
pendingReferral.referredOn.split(" ")[0],
referredTime:
pendingReferral.referredOn.split(" ")[1],
patientID: "${pendingReferral.patientID}",
isSameBranch: isSameBranch:
pendingReferral.isReferralDoctorSameBranch, pendingReferral.isReferralDoctorSameBranch,
isReferral: true,
remark: pendingReferral.remarksFromSource,
nationality: pendingReferral
.patientDetails.nationalityName,
nationalityFlag:
pendingReferral.nationalityFlagUrl,
doctorAvatar: pendingReferral.doctorImageUrl,
referralDoctorName: referralDoctorName:
pendingReferral.referredByDoctorInfo, pendingReferral.referredByDoctorInfo,
clinicDescription: null, clinicDescription: null,
remark: pendingReferral.remarksFromSource,
referredOn: pendingReferral.referredOn,
patientInfo: pendingReferral,
), ),
Padding( Padding(
padding: const EdgeInsets.symmetric(horizontal: 16), padding:
const EdgeInsets.symmetric(horizontal: 16),
child: SizedBox( child: SizedBox(
child: ProfileMedicalInfoWidgetSearch( child: ProfileMedicalInfoWidgetSearch(
patient: model.patientArrivalList[0], patient: model.patientArrivalList[0],
@ -174,7 +171,9 @@ class MyReferralDetailScreen extends StatelessWidget {
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error); DrAppToastMsg.showErrorToast(model.error);
} else { } else {
DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsgAccept); DrAppToastMsg.showSuccesToast(
TranslationBase.of(context)
.referralSuccessMsgAccept);
Navigator.pop(context); Navigator.pop(context);
Navigator.pop(context); Navigator.pop(context);
} }
@ -198,7 +197,9 @@ class MyReferralDetailScreen extends StatelessWidget {
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error); DrAppToastMsg.showErrorToast(model.error);
} else { } else {
DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsgReject); DrAppToastMsg.showSuccesToast(
TranslationBase.of(context)
.referralSuccessMsgReject);
Navigator.pop(context); Navigator.pop(context);
Navigator.pop(context); Navigator.pop(context);
} }
@ -221,7 +222,8 @@ class MyReferralDetailScreen extends StatelessWidget {
onPressed: () => Navigator.pop(context), onPressed: () => Navigator.pop(context),
), ),
Expanded( Expanded(
child: AppText("" , child: AppText(
"",
fontSize: SizeConfig.textMultiplier * 2.5, fontSize: SizeConfig.textMultiplier * 2.5,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
backGroundcolor: Colors.white, backGroundcolor: Colors.white,

@ -51,23 +51,34 @@ class MyReferralPatientScreen extends StatelessWidget {
}); });
}, },
child: PatientReferralItemWidget( child: PatientReferralItemWidget(
"${model.pendingReferral[index].patientID}",
patientInfo: model.pendingReferral[index],
patientName:
model.pendingReferral[index].patientName,
referralStatus: referralStatus:
model.pendingReferral[index].referralStatus, model.pendingReferral[index].referralStatus,
isReferredTo: false, patientName:
model.pendingReferral[index].patientName,
patientGender: model
.pendingReferral[index].patientDetails.gender,
referredDate: model
.pendingReferral[index].referredOn
.split(" ")[0],
referredTime: model
.pendingReferral[index].referredOn
.split(" ")[1],
patientID:
"${model.pendingReferral[index].patientID}",
isSameBranch: model.pendingReferral[index] isSameBranch: model.pendingReferral[index]
.isReferralDoctorSameBranch, .isReferralDoctorSameBranch,
isReferral: true,
remark:
model.pendingReferral[index].remarksFromSource,
nationality: model.pendingReferral[index]
.patientDetails.nationalityName,
nationalityFlag:
model.pendingReferral[index].nationalityFlagUrl,
doctorAvatar:
model.pendingReferral[index].doctorImageUrl,
referralDoctorName: model referralDoctorName: model
.pendingReferral[index].referredByDoctorInfo, .pendingReferral[index].referredByDoctorInfo,
clinicDescription: null, clinicDescription: null,
remark:
model.pendingReferral[index].remarksFromSource,
referredOn: model.pendingReferral[index].referredOn,
answerFromTarget:
model.pendingReferral[index].answerFromTarget,
infoIcon: InkWell( infoIcon: InkWell(
onTap: () { onTap: () {
Navigator.of(context) Navigator.of(context)

@ -113,35 +113,58 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
model.patientReferral.length == 0 model.patientReferral.length == 0
? referralForm(model, screenSize) ? referralForm(model, screenSize)
: PatientReferralItemWidget( : PatientReferralItemWidget(
"${model.patientReferral[model.patientReferral.length - 1].patientID}", referralStatus: model
.patientReferral[
model.patientReferral.length - 1]
.referralStatus,
patientName: model patientName: model
.patientReferral[ .patientReferral[
model.patientReferral.length - 1] model.patientReferral.length - 1]
.patientName, .patientName,
referralStatus: patientGender: model
"${model.patientReferral[model.patientReferral.length - 1].referralStatus}",
isReferredTo: true,
isSameBranch: model
.patientReferral[ .patientReferral[
model.patientReferral.length - 1] model.patientReferral.length - 1]
.isReferralDoctorSameBranch, .patientDetails
referralDoctorName: model .gender,
referredDate: model
.patientReferral[ .patientReferral[
model.patientReferral.length - 1] model.patientReferral.length - 1]
.referredByDoctorInfo, .referredOn
clinicDescription: null, .split(" ")[0],
referredTime: model
.patientReferral[
model.patientReferral.length - 1]
.referredOn
.split(" ")[1],
patientID:
"${model.patientReferral[model.patientReferral.length - 1].patientID}",
isSameBranch: model
.patientReferral[
model.patientReferral.length - 1]
.isReferralDoctorSameBranch,
isReferral: true,
remark: model remark: model
.patientReferral[ .patientReferral[
model.patientReferral.length - 1] model.patientReferral.length - 1]
.remarksFromSource, .remarksFromSource,
referredOn: model nationality: model
.patientReferral[
model.patientReferral.length - 1]
.patientDetails
.nationalityName,
nationalityFlag: model
.patientReferral[ .patientReferral[
model.patientReferral.length - 1] model.patientReferral.length - 1]
.referredOn, .nationalityFlagUrl,
answerFromTarget: model doctorAvatar: model
.patientReferral[
model.patientReferral.length - 1]
.doctorImageUrl,
referralDoctorName: model
.patientReferral[ .patientReferral[
model.patientReferral.length - 1] model.patientReferral.length - 1]
.answerFromTarget, .referredByDoctorInfo,
clinicDescription: null,
), ),
], ],
), ),
@ -154,24 +177,28 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
color: HexColor("#359846"), color: HexColor("#359846"),
onPressed: () { onPressed: () {
setState(() { setState(() {
if(_referTo == null){ if (_referTo == null) {
branchError = TranslationBase.of(context).fieldRequired; branchError =
}else { TranslationBase.of(context).fieldRequired;
} else {
branchError = null; branchError = null;
} }
if(_selectedBranch == null){ if (_selectedBranch == null) {
hospitalError = TranslationBase.of(context).fieldRequired; hospitalError =
}else { TranslationBase.of(context).fieldRequired;
} else {
hospitalError = null; hospitalError = null;
} }
if(_selectedClinic == null){ if (_selectedClinic == null) {
clinicError = TranslationBase.of(context).fieldRequired; clinicError =
}else { TranslationBase.of(context).fieldRequired;
} else {
clinicError = null; clinicError = null;
} }
if(_selectedDoctor == null){ if (_selectedDoctor == null) {
doctorError = TranslationBase.of(context).fieldRequired; doctorError =
}else { TranslationBase.of(context).fieldRequired;
} else {
doctorError = null; doctorError = null;
} }
}); });
@ -336,7 +363,8 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await model await model
.getClinicDoctors( .getClinicDoctors(
_selectedClinic['ClinicID'].toString(), _selectedBranch['facilityId']) _selectedClinic['ClinicID'].toString(),
_selectedBranch['facilityId'])
.then((_) => .then((_) =>
GifLoaderDialogUtils.hideDialog(context)); GifLoaderDialogUtils.hideDialog(context));
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
@ -391,11 +419,14 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
}, },
); );
} }
: (){ : () {
if(_selectedClinic == null){ if (_selectedClinic == null) {
DrAppToastMsg.showErrorToast("You need to select a clinic first"); DrAppToastMsg.showErrorToast(
} else if(model.doctorsList == null || model.doctorsList.length == 0){ "You need to select a clinic first");
DrAppToastMsg.showErrorToast("There is no doctors for this clinic"); } else if (model.doctorsList == null ||
model.doctorsList.length == 0) {
DrAppToastMsg.showErrorToast(
"There is no doctors for this clinic");
} }
}, },
), ),
@ -414,7 +445,7 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
Icons.calendar_today, Icons.calendar_today,
color: Colors.black, color: Colors.black,
), ),
onClick: (){ onClick: () {
_selectDate(context, model); _selectDate(context, model);
}, },
), ),
@ -422,8 +453,7 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
height: 10, height: 10,
), ),
AppTextFieldCustom( AppTextFieldCustom(
hintText: hintText: TranslationBase.of(context).dietTypeRemarks,
TranslationBase.of(context).dietTypeRemarks,
controller: _remarksController, controller: _remarksController,
inputType: TextInputType.multiline, inputType: TextInputType.multiline,
minLines: 4, minLines: 4,

@ -46,7 +46,8 @@ class ReferredPatientScreen extends StatelessWidget {
), ),
...List.generate( ...List.generate(
model.listMyReferredPatientModel.length, model.listMyReferredPatientModel.length,
(index) => PatientReferralItemWidget( (index) =>
Container() /*PatientReferralItemWidget(
"${model.getReferredPatientItem(index).patientId}", "${model.getReferredPatientItem(index).patientId}",
patientName: patientName:
"${model.getReferredPatientItem(index).firstName} ${model.getReferredPatientItem(index).middleName} ${model.getReferredPatientItem(index).lastName}", "${model.getReferredPatientItem(index).firstName} ${model.getReferredPatientItem(index).middleName} ${model.getReferredPatientItem(index).lastName}",
@ -71,7 +72,8 @@ class ReferredPatientScreen extends StatelessWidget {
null null
? DateUtils.convertDateFromServerFormat(model.getReferredPatientItem(index).referralDate, "dd/MM/yyyy") ? DateUtils.convertDateFromServerFormat(model.getReferredPatientItem(index).referralDate, "dd/MM/yyyy")
: null, : null,
), )*/
,
), ),
], ],
), ),

@ -11,33 +11,38 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class PatientReferralItemWidget extends StatelessWidget { class PatientReferralItemWidget extends StatelessWidget {
final String referralStatus;
final String patientName; final String patientName;
final int patientGender;
final String referredDate;
final String referredTime;
final String patientID; final String patientID;
final String referralStatus;
final isReferredTo;
final isSameBranch; final isSameBranch;
final bool isReferral;
final String remark;
final String nationality;
final String nationalityFlag;
final String doctorAvatar;
final String referralDoctorName; final String referralDoctorName;
final String clinicDescription; final String clinicDescription;
final String remark;
final String referredOn;
final String answerFromTarget;
final Widget infoIcon; final Widget infoIcon;
final PendingReferral patientInfo;
PatientReferralItemWidget( PatientReferralItemWidget(
this.patientID, { {this.referralStatus,
this.patientName, this.patientName,
this.referralStatus, this.patientGender,
this.isReferredTo = false, this.referredDate,
this.referredTime,
this.patientID,
this.isSameBranch, this.isSameBranch,
this.isReferral,
this.remark,
this.nationality,
this.nationalityFlag,
this.doctorAvatar,
this.referralDoctorName, this.referralDoctorName,
this.clinicDescription, this.clinicDescription,
this.remark, this.infoIcon});
this.referredOn,
this.answerFromTarget,
this.infoIcon,
this.patientInfo,
});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -47,224 +52,6 @@ class PatientReferralItemWidget extends StatelessWidget {
margin: EdgeInsets.only(left: 16.0, right: 16.0, top: 8.0), margin: EdgeInsets.only(left: 16.0, right: 16.0, top: 8.0),
child: Column( child: Column(
children: [ children: [
// TODO should be removed by mousa
// Row(
// children: [
// Expanded(
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: <Widget>[
// if (referralStatus != null)
// Row(
// children: [
// AppText(
// TranslationBase.of(context).referralStatus,
// color: Colors.grey,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// Container(
// color: Color(0xFF4BA821),
// padding: EdgeInsets.all(4),
// child: AppText(
// referralStatus
// /*referralStatus == "46"
// ? TranslationBase.of(context).approved
// : TranslationBase.of(context).rejected*/
// ,
// color: Colors.white,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// ),
// ],
// ),
// SizedBox(
// height: 8,
// ),
// Row(
// children: [
// AppText(
// isReferredTo
// ? "${TranslationBase.of(context).referTo}: "
// : "${TranslationBase.of(context).referredFrom}: ",
// color: Colors.grey,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// AppText(
// isSameBranch
// ? TranslationBase.of(context).sameBranch
// : TranslationBase.of(context).otherBranch,
// color: Colors.black,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// ],
// ),
// SizedBox(
// height: 8,
// ),
// Row(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// AppText(
// "${TranslationBase.of(context).referralDoctor} : ",
// color: Colors.grey,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// Expanded(
// child: AppText(
// referralDoctorName != null
// ? "${TranslationBase.of(context).dr} $referralDoctorName"
// : "-",
// color: Colors.black,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// ),
// ],
// ),
// SizedBox(
// height: 8,
// ),
// if (clinicDescription != null)
// Row(
// children: [
// AppText(
// "${TranslationBase.of(context).clinic}: ",
// color: Colors.grey,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// AppText(
// clinicDescription,
// color: Colors.black,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// ],
// ),
// SizedBox(
// height: 8,
// ),
// Row(
// children: [
// AppText(
// "${TranslationBase.of(context).patientID}: ",
// color: Colors.grey,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// AppText(
// patientID ?? '-',
// color: Colors.black,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// ],
// ),
// SizedBox(
// height: 8,
// ),
// Row(
// children: [
// AppText(
// "${TranslationBase.of(context).patientName}: ",
// color: Colors.grey,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// AppText(
// patientName ?? '-',
// color: Colors.black,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// ],
// ),
// SizedBox(
// height: 8,
// ),
// Row(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// AppText(
// TranslationBase.of(context).referralRemark,
// color: Colors.grey,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// Expanded(
// child: AppText(
// remark,
// color: Colors.black,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// ),
// ],
// ),
// SizedBox(
// height: 8,
// ),
// Row(
// children: [
// AppText(
// TranslationBase.of(context).referredOn,
// color: Colors.grey,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// AppText(
// referredOn ?? '-',
// color: Colors.black,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// ],
// ),
// if (answerFromTarget != null)
// SizedBox(
// height: 8,
// ),
// if (answerFromTarget != null)
// Row(
// children: [
// AppText(
// TranslationBase.of(context).referralResponse,
// color: Colors.grey,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// AppText(
// answerFromTarget != "" ? answerFromTarget : '-',
// color: Colors.black,
// fontWeight: FontWeight.bold,
// fontSize: 12,
// ),
// ],
// ),
// SizedBox(
// height: 16,
// ),
// ],
// ),
// ),
// if (infoIcon != null) infoIcon,
// ],
// ),
// const Divider(
// color: Color(0xffCCCCCC),
// height: 1,
// thickness: 1,
// indent: 0,
// endIndent: 0,
// ),
// SizedBox(
// height: 8,
// ),
Container( Container(
child: CardWithBgWidget( child: CardWithBgWidget(
bgColor: referralStatus != null bgColor: referralStatus != null
@ -296,7 +83,7 @@ class PatientReferralItemWidget extends StatelessWidget {
: Colors.grey[500], : Colors.grey[500],
), ),
AppText( AppText(
referredOn, referredDate,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 2.0 * SizeConfig.textMultiplier, fontSize: 2.0 * SizeConfig.textMultiplier,
@ -309,7 +96,7 @@ class PatientReferralItemWidget extends StatelessWidget {
children: [ children: [
Expanded( Expanded(
child: AppText( child: AppText(
patientInfo.patientName, patientName,
fontSize: SizeConfig.textMultiplier * 2.2, fontSize: SizeConfig.textMultiplier * 2.2,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
backGroundcolor: Colors.white, backGroundcolor: Colors.white,
@ -320,7 +107,7 @@ class PatientReferralItemWidget extends StatelessWidget {
SizedBox( SizedBox(
width: 4, width: 4,
), ),
/*patient.gender*/ 1 == 1 patientGender == 1
? Icon( ? Icon(
DoctorApp.male_2, DoctorApp.male_2,
color: Colors.blue, color: Colors.blue,
@ -333,7 +120,7 @@ class PatientReferralItemWidget extends StatelessWidget {
width: 4, width: 4,
), ),
AppText( AppText(
referredOn, referredTime,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 1.8 * SizeConfig.textMultiplier, fontSize: 1.8 * SizeConfig.textMultiplier,
@ -359,7 +146,7 @@ class PatientReferralItemWidget extends StatelessWidget {
color: Color(0XFF575757), color: Color(0XFF575757),
), ),
AppText( AppText(
patientInfo.patientID.toString(), patientID,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 1.8 * SizeConfig.textMultiplier, fontSize: 1.8 * SizeConfig.textMultiplier,
@ -395,36 +182,25 @@ class PatientReferralItemWidget extends StatelessWidget {
Row( Row(
children: [ children: [
AppText( AppText(
/*patient.nationalityName ?? nationality != null ? nationality : "",
patient.nationality*/
"Saudi",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontSize: 1.4 * SizeConfig.textMultiplier, fontSize: 1.4 * SizeConfig.textMultiplier,
), ),
/* patient.nationality != null nationalityFlag != null
? ClipRRect( ? ClipRRect(
borderRadius: borderRadius: BorderRadius.circular(20.0),
BorderRadius
.circular(
20.0),
child: Image.network( child: Image.network(
patient nationalityFlag,
.nationalityFlagURL,
height: 25, height: 25,
width: 30, width: 30,
errorBuilder: errorBuilder: (BuildContext context,
(BuildContext Object exception,
context, StackTrace stackTrace) {
Object return Text('No Image');
exception,
StackTrace
stackTrace) {
return Text(
'No Image');
}, },
))*/ ))
/*:*/ SizedBox() : SizedBox()
], ],
) )
], ],
@ -442,7 +218,7 @@ class PatientReferralItemWidget extends StatelessWidget {
), ),
Expanded( Expanded(
child: AppText( child: AppText(
patientInfo.remarksFromSource, remark,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 1.8 * SizeConfig.textMultiplier, fontSize: 1.8 * SizeConfig.textMultiplier,
@ -457,7 +233,9 @@ class PatientReferralItemWidget extends StatelessWidget {
Container( Container(
margin: EdgeInsets.only(left: 10, right: 0), margin: EdgeInsets.only(left: 10, right: 0),
child: Image.asset( child: Image.asset(
infoIcon != null ? 'assets/images/patient/ic_ref_arrow_up.png' : 'assets/images/patient/ic_ref_arrow_left.png', isReferral
? 'assets/images/patient/ic_ref_arrow_up.png'
: 'assets/images/patient/ic_ref_arrow_left.png',
height: 50, height: 50,
width: 30, width: 30,
), ),
@ -469,9 +247,10 @@ class PatientReferralItemWidget extends StatelessWidget {
child: Container( child: Container(
width: 40, width: 40,
height: 40, height: 40,
child: Image.asset( child: CircleAvatar(
'assets/images/female_avatar.png', radius: 25.0,
fit: BoxFit.cover, backgroundImage: NetworkImage(doctorAvatar),
backgroundColor: Colors.transparent,
), ),
), ),
), ),
@ -482,29 +261,13 @@ class PatientReferralItemWidget extends StatelessWidget {
left: 10, top: 25, right: 10, bottom: 0), left: 10, top: 25, right: 10, bottom: 0),
child: Column( child: Column(
children: [ children: [
RichText( AppText(
text: TextSpan( referralDoctorName,
style: TextStyle(
fontSize:
2.0 * SizeConfig.textMultiplier,
color: Colors.black),
children: <TextSpan>[
TextSpan(
text: TranslationBase.of(context)
.referralDoctor +
" : ",
style: TextStyle(
fontSize: 14,
fontFamily: 'Poppins')),
TextSpan(
text: referralDoctorName,
style: TextStyle(
fontWeight: FontWeight.w700,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 15)), fontWeight: FontWeight.w700,
], fontSize: 1.7 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
), ),
)
], ],
), ),
), ),

@ -100,6 +100,15 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget {
nameLine1: TranslationBase.of(context).orders, nameLine1: TranslationBase.of(context).orders,
nameLine2: TranslationBase.of(context).prescription, nameLine2: TranslationBase.of(context).prescription,
icon: 'patient/order_prescription.png'), icon: 'patient/order_prescription.png'),
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: ORDER_PROCEDURE,
nameLine1: TranslationBase.of(context).orders,
nameLine2: TranslationBase.of(context).procedures,
icon: 'patient/Order_Procedures.png'),
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
@ -125,16 +134,6 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget {
// nameLine1: TranslationBase.of(context).admission, // nameLine1: TranslationBase.of(context).admission,
// nameLine2: TranslationBase.of(context).request, // nameLine2: TranslationBase.of(context).request,
// icon: 'heartbeat.png'), // icon: 'heartbeat.png'),
if (patientType == "1")
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: PROGRESS_NOTE,
nameLine1: TranslationBase.of(context).progress,
nameLine2: TranslationBase.of(context).note,
icon: 'patient/Progress_notes.png'),
], ],
), ),
); );

Loading…
Cancel
Save