Merge branch 'refferal_card' into patients-new-design

merge-requests/377/head
mosazaid 4 years ago
commit b3b2beef70

@ -328,7 +328,7 @@ const Map<String, Map<String, String>> localizedValues = {
'ar': 'لا وصفة طبية مدرجة' 'ar': 'لا وصفة طبية مدرجة'
}, },
'referTo': {'en': "Refer To", 'ar': 'محال إلى'}, 'referTo': {'en': "Refer To", 'ar': 'محال إلى'},
'referredFrom': {'en': "Referred From", 'ar': 'محال من'}, 'referredFrom': {'en': "From : ", 'ar': ' : من'},
'branch': {'en': "Branch", 'ar': 'الفرع'}, 'branch': {'en': "Branch", 'ar': 'الفرع'},
'chooseAppointment': {'en': "Choose Appointment", 'ar': 'اختر موعد'}, 'chooseAppointment': {'en': "Choose Appointment", 'ar': 'اختر موعد'},
'appointmentNo': {'en': "Appointment # : ", 'ar': '# الموعد:'}, 'appointmentNo': {'en': "Appointment # : ", 'ar': '# الموعد:'},

@ -23,6 +23,7 @@ class MyReferralPatientScreen extends StatelessWidget {
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: false, isShowAppBar: false,
appBarTitle: TranslationBase.of(context).referPatient, appBarTitle: TranslationBase.of(context).referPatient,
body: model.pendingReferral == null || model.pendingReferral.length == 0 body: model.pendingReferral == null || model.pendingReferral.length == 0
? Center( ? Center(
@ -33,33 +34,35 @@ class MyReferralPatientScreen extends StatelessWidget {
) )
: SingleChildScrollView( : SingleChildScrollView(
child: Container( child: Container(
// color: Colors.white,
height: MediaQuery.of(context).size.height,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox(height: 100), SizedBox(height: 100),
ProfileWelcomeWidget( // ProfileWelcomeWidget(
AppText( // AppText(
authProvider.selectedClinicName != null // authProvider.selectedClinicName != null
? authProvider.selectedClinicName // ? authProvider.selectedClinicName
: authProvider.doctorProfile.clinicDescription, // : authProvider.doctorProfile.clinicDescription,
fontSize: SizeConfig.textMultiplier * 1.7, // fontSize: SizeConfig.textMultiplier * 1.7,
color: Colors.white, // color: Colors.white,
textAlign: TextAlign.center, // textAlign: TextAlign.center,
), // ),
height: 100, // height: 100,
), // ),
SizedBox( // SizedBox(
height: 16, // height: 16,
), // ),
Padding( // Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0), // padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: AppText( // child: AppText(
TranslationBase.of(context).myReferralPatient, // TranslationBase.of(context).myReferralPatient,
color: Colors.black, // color: Colors.black,
fontWeight: FontWeight.bold, // fontWeight: FontWeight.bold,
fontSize: 16, // fontSize: 16,
), // ),
), // ),
...List.generate( ...List.generate(
model.pendingReferral.length, model.pendingReferral.length,
(index) => InkWell( (index) => InkWell(
@ -71,6 +74,7 @@ class MyReferralPatientScreen extends StatelessWidget {
}, },
child: PatientReferralItemWidget( child: PatientReferralItemWidget(
"${model.pendingReferral[index].patientID}", "${model.pendingReferral[index].patientID}",
patientInfo:model.pendingReferral[index] ,
patientName: patientName:
model.pendingReferral[index].patientName, model.pendingReferral[index].patientName,
referralStatus: null, referralStatus: null,

@ -37,6 +37,7 @@ class _PatientReferralScreen extends State<PatientReferralScreen>
appBarTitle: TranslationBase.of(context).patientsreferral, appBarTitle: TranslationBase.of(context).patientsreferral,
body: Scaffold( body: Scaffold(
extendBodyBehindAppBar: true, extendBodyBehindAppBar: true,
// backgroundColor: Colors.white,
appBar: PreferredSize( appBar: PreferredSize(
preferredSize: Size.fromHeight(65.0), preferredSize: Size.fromHeight(65.0),
child: Center( child: Center(

@ -1,6 +1,11 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/models/patient/my_referral/PendingReferral.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
class PatientReferralItemWidget extends StatelessWidget { class PatientReferralItemWidget extends StatelessWidget {
final String patientName; final String patientName;
@ -14,6 +19,7 @@ class PatientReferralItemWidget extends StatelessWidget {
final String referredOn; final String referredOn;
final String answerFromTarget; final String answerFromTarget;
final Widget infoIcon; final Widget infoIcon;
final PendingReferral patientInfo;
PatientReferralItemWidget( PatientReferralItemWidget(
this.patientID, { this.patientID, {
@ -27,6 +33,7 @@ class PatientReferralItemWidget extends StatelessWidget {
this.referredOn, this.referredOn,
this.answerFromTarget, this.answerFromTarget,
this.infoIcon, this.infoIcon,
this.patientInfo,
}); });
@override @override
@ -35,222 +42,379 @@ class PatientReferralItemWidget extends StatelessWidget {
margin: EdgeInsets.all(16.0), margin: EdgeInsets.all(16.0),
child: Column( child: Column(
children: [ children: [
Row( // TODO should be removed by mousa
children: [ // Row(
Expanded( // children: [
child: Column( // Expanded(
crossAxisAlignment: CrossAxisAlignment.start, // child: Column(
children: <Widget>[ // crossAxisAlignment: CrossAxisAlignment.start,
if (referralStatus != null) // children: <Widget>[
Row( // if (referralStatus != null)
children: [ // Row(
AppText( // children: [
TranslationBase.of(context).referralStatus, // AppText(
color: Colors.grey, // TranslationBase.of(context).referralStatus,
fontWeight: FontWeight.bold, // color: Colors.grey,
fontSize: 12, // fontWeight: FontWeight.bold,
), // fontSize: 12,
Container( // ),
color: Color(0xFF4BA821), // Container(
padding: EdgeInsets.all(4), // color: Color(0xFF4BA821),
child: AppText( // padding: EdgeInsets.all(4),
referralStatus // child: AppText(
/*referralStatus == "46" // referralStatus
? TranslationBase.of(context).approved // /*referralStatus == "46"
: TranslationBase.of(context).rejected*/ // ? TranslationBase.of(context).approved
, // : TranslationBase.of(context).rejected*/
color: Colors.white, // ,
fontWeight: FontWeight.bold, // color: Colors.white,
fontSize: 12, // fontWeight: FontWeight.bold,
), // fontSize: 12,
), // ),
], // ),
), // ],
SizedBox( // ),
height: 8, // SizedBox(
), // height: 8,
Row( // ),
children: [ // Row(
AppText( // children: [
isReferredTo // AppText(
? "${TranslationBase.of(context).referTo}: " // isReferredTo
: "${TranslationBase.of(context).referredFrom}: ", // ? "${TranslationBase.of(context).referTo}: "
color: Colors.grey, // : "${TranslationBase.of(context).referredFrom}: ",
fontWeight: FontWeight.bold, // color: Colors.grey,
fontSize: 12, // fontWeight: FontWeight.bold,
), // fontSize: 12,
AppText( // ),
isSameBranch // AppText(
? TranslationBase.of(context).sameBranch // isSameBranch
: TranslationBase.of(context).otherBranch, // ? TranslationBase.of(context).sameBranch
color: Colors.black, // : TranslationBase.of(context).otherBranch,
fontWeight: FontWeight.bold, // color: Colors.black,
fontSize: 12, // 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( SizedBox(
height: 8, height: 8,
), ),
Row( Container(
child: CardWithBgWidget(
bgColor: patientInfo.referralStatus == 'Pending'
? Colors.orange[400]
: Colors.red[800],
hasBorder: false,
widget: Container(
// padding: EdgeInsets.only(left: 20, right: 0, bottom: 0),
child: InkWell(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ 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( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
AppText( RichText(
"${TranslationBase.of(context).clinic}: ", text: new TextSpan(
color: Colors.grey, style: new TextStyle(
fontWeight: FontWeight.bold, fontSize: 2.0 * SizeConfig.textMultiplier,
fontSize: 12, color: Colors.black),
), children: <TextSpan>[
AppText( new TextSpan(
clinicDescription, text: patientInfo.referralStatus,
color: Colors.black, style: TextStyle(
fontWeight: FontWeight.bold, color: patientInfo.referralStatus ==
fontSize: 12, 'Pending'
), ? Colors.orange[400]
: Colors.red[800],
fontWeight: FontWeight.w700,
fontFamily: 'Poppins',
fontSize: 18)),
], ],
), ),
SizedBox(
height: 8,
),
Row(
children: [
AppText(
"${TranslationBase.of(context).patientID}: ",
color: Colors.grey,
fontWeight: FontWeight.bold,
fontSize: 12,
), ),
//TODO :ask backend to return in the standerformate
AppText( AppText(
patientID ?? '-', referredOn,
color: Colors.black, fontFamily: 'Poppins',
fontWeight: FontWeight.bold, fontWeight: FontWeight.w600,
fontSize: 12, )
),
], ],
), ),
SizedBox(
height: 8,
),
Row(
children: [
AppText(
"${TranslationBase.of(context).patientName}: ",
color: Colors.grey,
fontWeight: FontWeight.bold,
fontSize: 12,
),
AppText( AppText(
patientName ?? '-', patientInfo.patientName,
color: Colors.black, fontSize: SizeConfig.textMultiplier * 2,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 12, backGroundcolor: Colors.white,
fontFamily: 'Poppins',
), ),
SizedBox(
width: 10,
),
RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: 2.0 * SizeConfig.textMultiplier,
color: Colors.black),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(context).fileNumber,
style: TextStyle(
fontSize: 14, fontFamily: 'Poppins')),
new TextSpan(
text: patientInfo.patientID.toString(),
style: TextStyle(
fontWeight: FontWeight.w700,
fontFamily: 'Poppins',
fontSize: 15)),
], ],
), ),
SizedBox(
height: 8,
), ),
Row( Container(
crossAxisAlignment: CrossAxisAlignment.start, child: RichText(
children: [ text: new TextSpan(
AppText( style: new TextStyle(
TranslationBase.of(context).referralRemark, fontSize: 2.0 * SizeConfig.textMultiplier,
color: Colors.grey, color: Colors.black),
fontWeight: FontWeight.bold, children: <TextSpan>[
fontSize: 12, new TextSpan(
text: TranslationBase.of(context).referredFrom,
style: TextStyle(
fontSize: 14, fontFamily: 'Poppins')),
new TextSpan(
text: isSameBranch
? TranslationBase.of(context).sameBranch
: TranslationBase.of(context).otherBranch,
style: TextStyle(
fontWeight: FontWeight.w700,
fontFamily: 'Poppins',
fontSize: 15)),
],
), ),
Expanded(
child: AppText(
remark,
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 12,
), ),
), ),
Container(
child: RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: 2.0 * SizeConfig.textMultiplier,
color: Colors.black),
children: <TextSpan>[
new TextSpan(
text:
TranslationBase.of(context).remarks + " : ",
style: TextStyle(
fontSize: 14, fontFamily: 'Poppins')),
new TextSpan(
text: patientInfo.remarksFromSource,
style: TextStyle(
fontWeight: FontWeight.w700,
fontFamily: 'Poppins',
fontSize: 15)),
], ],
), ),
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( SizedBox(
height: 8, height: 20,
), ),
if (answerFromTarget != null) Column(
Row(
children: [ children: [
AppText( RichText(
TranslationBase.of(context).referralResponse, text: TextSpan(
color: Colors.grey, style: TextStyle(
fontWeight: FontWeight.bold, fontSize: 2.0 * SizeConfig.textMultiplier,
fontSize: 12, color: Colors.black),
), children: <TextSpan>[
AppText( TextSpan(
answerFromTarget != "" ? answerFromTarget : '-', text: TranslationBase.of(context)
color: Colors.black, .referralDoctor +
fontWeight: FontWeight.bold, " : ",
fontSize: 12, style: TextStyle(
), fontSize: 14, fontFamily: 'Poppins')),
TextSpan(
text: referralDoctorName,
style: TextStyle(
fontWeight: FontWeight.w700,
fontFamily: 'Poppins',
fontSize: 15)),
], ],
), ),
SizedBox( )
height: 16,
),
], ],
), ),
), Container(
if (infoIcon != null) infoIcon, width: double.infinity,
alignment: Alignment.centerRight,
child: Icon(FontAwesomeIcons.arrowRight,
size: 25, color: Colors.black))
], ],
), ),
const Divider( // onTap: onTap,
color: Color(0xffCCCCCC), )),
height: 1,
thickness: 1,
indent: 0,
endIndent: 0,
), ),
SizedBox(
height: 8,
), ),
], ],
), ),

@ -13,8 +13,11 @@ import 'package:provider/provider.dart';
class CardWithBgWidget extends StatelessWidget { class CardWithBgWidget extends StatelessWidget {
final Widget widget; final Widget widget;
final Color bgColor;
final bool hasBorder;
CardWithBgWidget({@required this.widget}); CardWithBgWidget(
{@required this.widget, this.bgColor, this.hasBorder = true});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -26,7 +29,9 @@ class CardWithBgWidget extends StatelessWidget {
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(10.0), Radius.circular(10.0),
), ),
border: Border.all(color: HexColor('#707070'), width: 2.0), border: Border.all(
color: hasBorder ? HexColor('#707070') : Colors.transparent,
width: hasBorder ? 2.0 : 0),
), ),
child: Material( child: Material(
borderRadius: BorderRadius.all(Radius.circular(10.0)), borderRadius: BorderRadius.all(Radius.circular(10.0)),
@ -35,22 +40,32 @@ class CardWithBgWidget extends StatelessWidget {
if (projectProvider.isArabic) if (projectProvider.isArabic)
Positioned( Positioned(
child: Container( child: Container(
decoration: BoxDecoration(
color: bgColor ?? HexColor('#58434F'),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(10),
bottomLeft: Radius.circular(10),),),
width: 10, width: 10,
color: HexColor('#58434F'),
), ),
bottom: 0, bottom: 1,
top: 0, top: 1,
right: 0, right: 1,
) )
else else
Positioned( Positioned(
child: Container( child: Container(
decoration: BoxDecoration(
color: bgColor ?? HexColor('#58434F'),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(10),
bottomLeft: Radius.circular(10),),),
width: 10, width: 10,
color: HexColor('#58434F'),
), ),
bottom: 0, bottom: 1,
top: 0, top: 1,
left: 0, left: 1,
), ),
Container( Container(
padding: EdgeInsets.all(15.0), padding: EdgeInsets.all(15.0),

Loading…
Cancel
Save