|
|
|
@ -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/translations_delegate_base.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/shared/app_scaffold_widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/borderedButton.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
|
|
|
|
import 'package:hexcolor/hexcolor.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
|
|
import '../../../../routes.dart';
|
|
|
|
|
|
|
|
|
|
class MyReferralDetailScreen extends StatelessWidget {
|
|
|
|
|
PendingReferral pendingReferral;
|
|
|
|
|
|
|
|
|
@ -37,7 +32,7 @@ class MyReferralDetailScreen extends StatelessWidget {
|
|
|
|
|
return BaseView<PatientReferralViewModel>(
|
|
|
|
|
onModelReady: (model) => model.getPatientDetails(
|
|
|
|
|
DateUtils.convertStringToDateFormat(
|
|
|
|
|
DateTime.now()/*.subtract(Duration(days: 350))*/.toString(),
|
|
|
|
|
DateTime.now() /*.subtract(Duration(days: 350))*/ .toString(),
|
|
|
|
|
"yyyy-MM-dd"),
|
|
|
|
|
DateUtils.convertStringToDateFormat(
|
|
|
|
|
DateTime.now().toString(), "yyyy-MM-dd"),
|
|
|
|
@ -52,14 +47,13 @@ class MyReferralDetailScreen extends StatelessWidget {
|
|
|
|
|
? Column(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
left: 0, right: 5, bottom: 5, top: 5),
|
|
|
|
|
padding:
|
|
|
|
|
EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
),
|
|
|
|
|
child: Container(
|
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
left: 10, right: 10, bottom: 10),
|
|
|
|
|
padding: EdgeInsets.only(left: 10, right: 10, bottom: 10),
|
|
|
|
|
margin: EdgeInsets.only(top: 50),
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
@ -73,24 +67,238 @@ class MyReferralDetailScreen extends StatelessWidget {
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: AppText(
|
|
|
|
|
(Helpers.capitalize(model.patientArrivalList[0].patientDetails.fullName)),
|
|
|
|
|
(Helpers.capitalize(model
|
|
|
|
|
.patientArrivalList[0]
|
|
|
|
|
.patientDetails
|
|
|
|
|
.fullName)),
|
|
|
|
|
fontSize: SizeConfig.textMultiplier * 2.5,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
backGroundcolor: Colors.white,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
model.patientArrivalList[0].patientDetails.gender == 1
|
|
|
|
|
model.patientArrivalList[0].patientDetails
|
|
|
|
|
.gender ==
|
|
|
|
|
1
|
|
|
|
|
? Icon(
|
|
|
|
|
DoctorApp.male_2,
|
|
|
|
|
color: Colors.blue,
|
|
|
|
|
)
|
|
|
|
|
DoctorApp.male_2,
|
|
|
|
|
color: Colors.blue,
|
|
|
|
|
)
|
|
|
|
|
: Icon(
|
|
|
|
|
DoctorApp.female_1,
|
|
|
|
|
color: Colors.pink,
|
|
|
|
|
),
|
|
|
|
|
DoctorApp.female_1,
|
|
|
|
|
color: Colors.pink,
|
|
|
|
|
),
|
|
|
|
|
]),
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.only(left: 12.0),
|
|
|
|
|
child: Container(
|
|
|
|
|
width: 60,
|
|
|
|
|
height: 60,
|
|
|
|
|
child: Image.asset(
|
|
|
|
|
pendingReferral.patientDetails.gender == 1
|
|
|
|
|
? 'assets/images/male_avatar.png'
|
|
|
|
|
: 'assets/images/female_avatar.png',
|
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 10,
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
pendingReferral.referralStatus != null ? pendingReferral.referralStatus : "",
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontSize: 1.9 * SizeConfig.textMultiplier,
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
color: pendingReferral.referralStatus != null
|
|
|
|
|
? pendingReferral.referralStatus == 'Pending'
|
|
|
|
|
? Color(0xffc4aa54)
|
|
|
|
|
: pendingReferral.referralStatus == 'Accepted'
|
|
|
|
|
? Colors.green[700]
|
|
|
|
|
: Colors.red[700]
|
|
|
|
|
: Colors.grey[500],
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
pendingReferral.referredOn.split(" ")[0],
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
fontSize: 2.0 * SizeConfig.textMultiplier,
|
|
|
|
|
color: Color(0XFF28353E),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context).fileNumber,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
fontSize: 1.7 * SizeConfig.textMultiplier,
|
|
|
|
|
color: Color(0XFF575757),
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
"${pendingReferral.patientID}",
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
fontSize: 1.8 * SizeConfig.textMultiplier,
|
|
|
|
|
color: Color(0XFF2E303A),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
pendingReferral.referredOn.split(" ")[1],
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
fontSize: 1.8 * SizeConfig.textMultiplier,
|
|
|
|
|
color: Color(0XFF575757),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context).referredFrom,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
fontSize: 1.7 * SizeConfig.textMultiplier,
|
|
|
|
|
color: Color(0XFF575757),
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
pendingReferral.isReferralDoctorSameBranch
|
|
|
|
|
? TranslationBase.of(context).sameBranch
|
|
|
|
|
: TranslationBase.of(context)
|
|
|
|
|
.otherBranch,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
fontSize: 1.8 * SizeConfig.textMultiplier,
|
|
|
|
|
color: Color(0XFF2E303A),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context).remarks + " : ",
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
fontSize: 1.7 * SizeConfig.textMultiplier,
|
|
|
|
|
color: Color(0XFF575757),
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: AppText(
|
|
|
|
|
pendingReferral.remarksFromSource,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
fontSize: 1.8 * SizeConfig.textMultiplier,
|
|
|
|
|
color: Color(0XFF2E303A),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
pendingReferral
|
|
|
|
|
.patientDetails.nationalityName != null ? pendingReferral
|
|
|
|
|
.patientDetails.nationalityName : "",
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
color: Color(0xFF2E303A),
|
|
|
|
|
fontSize: 1.4 * SizeConfig.textMultiplier,
|
|
|
|
|
),
|
|
|
|
|
pendingReferral.nationalityFlagUrl != null
|
|
|
|
|
? ClipRRect(
|
|
|
|
|
borderRadius: BorderRadius.circular(20.0),
|
|
|
|
|
child: Image.network(
|
|
|
|
|
pendingReferral.nationalityFlagUrl,
|
|
|
|
|
height: 25,
|
|
|
|
|
width: 30,
|
|
|
|
|
errorBuilder: (BuildContext context,
|
|
|
|
|
Object exception,
|
|
|
|
|
StackTrace stackTrace) {
|
|
|
|
|
return Text('No Image');
|
|
|
|
|
},
|
|
|
|
|
))
|
|
|
|
|
: SizedBox()
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(left: 10, right: 0),
|
|
|
|
|
child: Image.asset('assets/images/patient/ic_ref_arrow_up.png',
|
|
|
|
|
height: 50,
|
|
|
|
|
width: 30,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
|
left: 0, top: 25, right: 0, bottom: 0),
|
|
|
|
|
padding: EdgeInsets.only(left: 4.0, right: 4.0),
|
|
|
|
|
child: Container(
|
|
|
|
|
width: 40,
|
|
|
|
|
height: 40,
|
|
|
|
|
child: CircleAvatar(
|
|
|
|
|
radius: 25.0,
|
|
|
|
|
backgroundImage: NetworkImage(pendingReferral.doctorImageUrl),
|
|
|
|
|
backgroundColor: Colors.transparent,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 4,
|
|
|
|
|
child: Container(
|
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
|
left: 10, top: 25, right: 10, bottom: 0),
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
pendingReferral.referredByDoctorInfo,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
fontSize: 1.7 * SizeConfig.textMultiplier,
|
|
|
|
|
color: Color(0XFF2E303A),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
@ -101,22 +309,10 @@ class MyReferralDetailScreen extends StatelessWidget {
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
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(
|
|
|
|
|
height: 16,
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
/*Padding(
|
|
|
|
|
padding:
|
|
|
|
|
const EdgeInsets.symmetric(horizontal: 16.0),
|
|
|
|
|
child: AppText(
|
|
|
|
@ -125,23 +321,33 @@ class MyReferralDetailScreen extends StatelessWidget {
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
PatientReferralItemWidget(
|
|
|
|
|
"${pendingReferral.patientID}",
|
|
|
|
|
patientName: pendingReferral.patientName,
|
|
|
|
|
),*/
|
|
|
|
|
/*PatientReferralItemWidget(
|
|
|
|
|
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:
|
|
|
|
|
pendingReferral.isReferralDoctorSameBranch,
|
|
|
|
|
isReferral: true,
|
|
|
|
|
remark: pendingReferral.remarksFromSource,
|
|
|
|
|
nationality: pendingReferral
|
|
|
|
|
.patientDetails.nationalityName,
|
|
|
|
|
nationalityFlag:
|
|
|
|
|
pendingReferral.nationalityFlagUrl,
|
|
|
|
|
doctorAvatar: pendingReferral.doctorImageUrl,
|
|
|
|
|
referralDoctorName:
|
|
|
|
|
pendingReferral.referredByDoctorInfo,
|
|
|
|
|
clinicDescription: null,
|
|
|
|
|
remark: pendingReferral.remarksFromSource,
|
|
|
|
|
referredOn: pendingReferral.referredOn,
|
|
|
|
|
patientInfo: pendingReferral,
|
|
|
|
|
),
|
|
|
|
|
),*/
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 16),
|
|
|
|
|
padding:
|
|
|
|
|
const EdgeInsets.symmetric(horizontal: 16),
|
|
|
|
|
child: SizedBox(
|
|
|
|
|
child: ProfileMedicalInfoWidgetSearch(
|
|
|
|
|
patient: model.patientArrivalList[0],
|
|
|
|
@ -174,7 +380,9 @@ class MyReferralDetailScreen extends StatelessWidget {
|
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
|
DrAppToastMsg.showErrorToast(model.error);
|
|
|
|
|
} else {
|
|
|
|
|
DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsgAccept);
|
|
|
|
|
DrAppToastMsg.showSuccesToast(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.referralSuccessMsgAccept);
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
}
|
|
|
|
@ -198,7 +406,9 @@ class MyReferralDetailScreen extends StatelessWidget {
|
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
|
DrAppToastMsg.showErrorToast(model.error);
|
|
|
|
|
} else {
|
|
|
|
|
DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsgReject);
|
|
|
|
|
DrAppToastMsg.showSuccesToast(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.referralSuccessMsgReject);
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
}
|
|
|
|
@ -211,26 +421,27 @@ class MyReferralDetailScreen extends StatelessWidget {
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
padding: EdgeInsets.only(left: 12.0),
|
|
|
|
|
child: Row(children: [
|
|
|
|
|
IconButton(
|
|
|
|
|
icon: Icon(Icons.arrow_back_ios),
|
|
|
|
|
color: Colors.black, //Colors.black,
|
|
|
|
|
onPressed: () => Navigator.pop(context),
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: AppText("" ,
|
|
|
|
|
fontSize: SizeConfig.textMultiplier * 2.5,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
backGroundcolor: Colors.white,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
padding: EdgeInsets.only(left: 12.0),
|
|
|
|
|
child: Row(children: [
|
|
|
|
|
IconButton(
|
|
|
|
|
icon: Icon(Icons.arrow_back_ios),
|
|
|
|
|
color: Colors.black, //Colors.black,
|
|
|
|
|
onPressed: () => Navigator.pop(context),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
]),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
Expanded(
|
|
|
|
|
child: AppText(
|
|
|
|
|
"",
|
|
|
|
|
fontSize: SizeConfig.textMultiplier * 2.5,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
backGroundcolor: Colors.white,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
]),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
child: Center(
|
|
|
|
|
child: AppText(
|
|
|
|
|
TranslationBase.of(context).patientNoDetailErrMsg,
|
|
|
|
@ -240,8 +451,8 @@ class MyReferralDetailScreen extends StatelessWidget {
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|