|
|
|
|
@ -16,7 +16,7 @@ import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
|
|
// ignore: must_be_immutable
|
|
|
|
|
class MyReferralDetailScreen extends StatelessWidget {
|
|
|
|
|
final MyReferralPatientModel referralPatient;
|
|
|
|
|
final MyReferralPatientModel? referralPatient;
|
|
|
|
|
|
|
|
|
|
const MyReferralDetailScreen({Key? key, this.referralPatient}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
@ -29,7 +29,7 @@ class MyReferralDetailScreen extends StatelessWidget {
|
|
|
|
|
onModelReady: (model) => model.getDoctorProfile(),
|
|
|
|
|
builder: (_, model, w) => AppScaffold(
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
appBarTitle: TranslationBase.of(context).referPatient,
|
|
|
|
|
appBarTitle: TranslationBase.of(context).referPatient!,
|
|
|
|
|
isShowAppBar: false,
|
|
|
|
|
body: Column(
|
|
|
|
|
children: [
|
|
|
|
|
@ -53,13 +53,13 @@ class MyReferralDetailScreen extends StatelessWidget {
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: AppText(
|
|
|
|
|
(Helpers.capitalize(referralPatient.firstName + " " + referralPatient.lastName)),
|
|
|
|
|
(Helpers.capitalize(referralPatient!.firstName! + " " + referralPatient!.lastName!)),
|
|
|
|
|
fontSize: SizeConfig.textMultiplier * 2.5,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
referralPatient.gender == 1
|
|
|
|
|
referralPatient!.gender! == 1
|
|
|
|
|
? Icon(
|
|
|
|
|
DoctorApp.male_2,
|
|
|
|
|
color: Colors.blue,
|
|
|
|
|
@ -79,7 +79,7 @@ class MyReferralDetailScreen extends StatelessWidget {
|
|
|
|
|
width: 60,
|
|
|
|
|
height: 60,
|
|
|
|
|
child: Image.asset(
|
|
|
|
|
referralPatient.gender == 1
|
|
|
|
|
referralPatient!.gender == 1
|
|
|
|
|
? 'assets/images/male_avatar.png'
|
|
|
|
|
: 'assets/images/female_avatar.png',
|
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
|
@ -96,20 +96,20 @@ class MyReferralDetailScreen extends StatelessWidget {
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
referralPatient.referralStatus != null
|
|
|
|
|
? model.getReferralStatusNameByCode(referralPatient.referralStatus, context)
|
|
|
|
|
referralPatient!.referralStatus != null
|
|
|
|
|
? model.getReferralStatusNameByCode(referralPatient!.referralStatus!, context)
|
|
|
|
|
: "",
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontSize: 1.9 * SizeConfig.textMultiplier,
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
color: referralPatient.referralStatus == 1
|
|
|
|
|
color: referralPatient!.referralStatus == 1
|
|
|
|
|
? Color(0xffc4aa54)
|
|
|
|
|
: referralPatient.referralStatus == 46 || referralPatient.referralStatus == 2
|
|
|
|
|
: referralPatient!.referralStatus == 46 || referralPatient!.referralStatus! == 2
|
|
|
|
|
? Colors.green[700]
|
|
|
|
|
: Colors.red[700],
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
AppDateUtils.getDayMonthYearDateFormatted(referralPatient.referralDate),
|
|
|
|
|
AppDateUtils.getDayMonthYearDateFormatted(referralPatient!.referralDate!),
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
fontSize: 2.0 * SizeConfig.textMultiplier,
|
|
|
|
|
@ -131,7 +131,7 @@ class MyReferralDetailScreen extends StatelessWidget {
|
|
|
|
|
color: Color(0XFF575757),
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
"${referralPatient.patientID}",
|
|
|
|
|
"${referralPatient!.patientID}",
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
fontSize: 1.8 * SizeConfig.textMultiplier,
|
|
|
|
|
@ -140,7 +140,7 @@ class MyReferralDetailScreen extends StatelessWidget {
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
AppDateUtils.getTimeHHMMA(referralPatient.referralDate),
|
|
|
|
|
AppDateUtils.getTimeHHMMA(referralPatient!.referralDate!),
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
fontSize: 1.8 * SizeConfig.textMultiplier,
|
|
|
|
|
@ -166,7 +166,7 @@ class MyReferralDetailScreen extends StatelessWidget {
|
|
|
|
|
color: Color(0XFF575757),
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
referralPatient.targetProjectId == referralPatient.sourceProjectId
|
|
|
|
|
referralPatient!.targetProjectId! == referralPatient!.sourceProjectId!
|
|
|
|
|
? TranslationBase.of(context).sameBranch
|
|
|
|
|
: TranslationBase.of(context).otherBranch,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
@ -181,7 +181,7 @@ class MyReferralDetailScreen extends StatelessWidget {
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context).remarks + " : ",
|
|
|
|
|
TranslationBase.of(context).remarks! + " : ",
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
fontSize: 1.7 * SizeConfig.textMultiplier,
|
|
|
|
|
@ -189,7 +189,7 @@ class MyReferralDetailScreen extends StatelessWidget {
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: AppText(
|
|
|
|
|
referralPatient.referringDoctorRemarks ?? '',
|
|
|
|
|
referralPatient!.referringDoctorRemarks ?? '',
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
fontSize: 1.8 * SizeConfig.textMultiplier,
|
|
|
|
|
@ -204,22 +204,22 @@ class MyReferralDetailScreen extends StatelessWidget {
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
referralPatient.nationalityName != null
|
|
|
|
|
? referralPatient.nationalityName
|
|
|
|
|
referralPatient!.nationalityName != null
|
|
|
|
|
? referralPatient!.nationalityName
|
|
|
|
|
: "",
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
color: Color(0xFF2E303A),
|
|
|
|
|
fontSize: 1.4 * SizeConfig.textMultiplier,
|
|
|
|
|
),
|
|
|
|
|
referralPatient.nationalityFlagURL != null
|
|
|
|
|
referralPatient!.nationalityFlagURL != null
|
|
|
|
|
? ClipRRect(
|
|
|
|
|
borderRadius: BorderRadius.circular(20.0),
|
|
|
|
|
child: Image.network(
|
|
|
|
|
referralPatient.nationalityFlagURL,
|
|
|
|
|
referralPatient!.nationalityFlagURL!,
|
|
|
|
|
height: 25,
|
|
|
|
|
width: 30,
|
|
|
|
|
errorBuilder:
|
|
|
|
|
(BuildContext context, Object exception, StackTrace stackTrace) {
|
|
|
|
|
(BuildContext ?context, Object ?exception, StackTrace? stackTrace) {
|
|
|
|
|
return Text('No Image');
|
|
|
|
|
},
|
|
|
|
|
))
|
|
|
|
|
@ -247,7 +247,7 @@ class MyReferralDetailScreen extends StatelessWidget {
|
|
|
|
|
height: 40,
|
|
|
|
|
child: CircleAvatar(
|
|
|
|
|
radius: 25.0,
|
|
|
|
|
backgroundImage: NetworkImage(referralPatient.doctorImageURL),
|
|
|
|
|
backgroundImage: NetworkImage(referralPatient!.doctorImageURL!),
|
|
|
|
|
backgroundColor: Colors.transparent,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
@ -259,7 +259,7 @@ class MyReferralDetailScreen extends StatelessWidget {
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
referralPatient.doctorName,
|
|
|
|
|
referralPatient!.doctorName,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
fontSize: 1.7 * SizeConfig.textMultiplier,
|
|
|
|
|
@ -293,7 +293,7 @@ class MyReferralDetailScreen extends StatelessWidget {
|
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 16),
|
|
|
|
|
child: SizedBox(
|
|
|
|
|
child: ProfileMedicalInfoWidgetSearch(
|
|
|
|
|
patient: model.getPatientFromReferralO(referralPatient),
|
|
|
|
|
patient: model.getPatientFromReferralO(referralPatient!),
|
|
|
|
|
patientType: "7",
|
|
|
|
|
isInpatient: false,
|
|
|
|
|
from: null,
|
|
|
|
|
@ -306,7 +306,7 @@ class MyReferralDetailScreen extends StatelessWidget {
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
if (referralPatient.referralStatus == 1)
|
|
|
|
|
if (referralPatient!.referralStatus == 1)
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
|
|
|
|
|
child: Row(
|
|
|
|
|
@ -321,7 +321,7 @@ class MyReferralDetailScreen extends StatelessWidget {
|
|
|
|
|
vPadding: 12,
|
|
|
|
|
disabled: model.state == ViewState.Busy,
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
await model.responseReferral(referralPatient, true);
|
|
|
|
|
await model.responseReferral(referralPatient!, true);
|
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
|
DrAppToastMsg.showErrorToast(model.error);
|
|
|
|
|
} else {
|
|
|
|
|
@ -346,7 +346,7 @@ class MyReferralDetailScreen extends StatelessWidget {
|
|
|
|
|
vPadding: 12,
|
|
|
|
|
disabled: model.state == ViewState.Busy,
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
await model.responseReferral(referralPatient, false);
|
|
|
|
|
await model.responseReferral(referralPatient!, false);
|
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
|
DrAppToastMsg.showErrorToast(model.error);
|
|
|
|
|
} else {
|
|
|
|
|
|