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

merge-requests/406/head
hussam al-habibeh 5 years ago
commit 29029a7dea

@ -4,8 +4,8 @@ const MAX_SMALL_SCREEN = 660;
const ONLY_NUMBERS = "[0-9]"; const ONLY_NUMBERS = "[0-9]";
const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_LETTERS = "[a-zA-Z &'\"]";
const ONLY_DATE = "[0-9/]"; const ONLY_DATE = "[0-9/]";
//const BASE_URL = 'https://hmgwebservices.com/'; const BASE_URL = 'https://hmgwebservices.com/';
const BASE_URL = 'https://uat.hmgwebservices.com/'; // const BASE_URL = 'https://uat.hmgwebservices.com/';
const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh";
const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList";
const PATIENT_PROGRESS_NOTE_URL = const PATIENT_PROGRESS_NOTE_URL =

@ -333,7 +333,7 @@ const Map<String, Map<String, String>> localizedValues = {
'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': '# الموعد:'},
'refer': {'en': "REFER", 'ar': 'إحالة'}, 'refer': {'en': "Refer", 'ar': 'إحالة'},
'rejected': {'en': "Rejected", 'ar': 'مرفوض'}, 'rejected': {'en': "Rejected", 'ar': 'مرفوض'},
'sameBranch': {'en': "Same Branch", 'ar': 'نفس الفرع'}, 'sameBranch': {'en': "Same Branch", 'ar': 'نفس الفرع'},
'otherBranch': {'en': "Other Branch", 'ar': 'فرع آخر'}, 'otherBranch': {'en': "Other Branch", 'ar': 'فرع آخر'},

@ -5,6 +5,7 @@ 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/date-utils.dart'; import 'package:doctor_app_flutter/util/date-utils.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/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.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/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
@ -28,15 +29,16 @@ class ECGPage extends StatelessWidget {
patientID: patient.patientId), patientID: patient.patientId),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: false, isShowAppBar: true,
backgroundColor: Color(0xffF8F8F8), backgroundColor: Color(0xffF8F8F8),
appBar: PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType),
body: SingleChildScrollView( body: SingleChildScrollView(
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
PatientProfileHeaderNewDesign(patient,arrivalType??'0',patientType), // PatientProfileHeaderNewDesign(patient,arrivalType??'0',patientType),
SizedBox(height: 12,), SizedBox(height: 12,),
Texts('Service',style: "caption2",color: Colors.black,), Texts('Service',style: "caption2",color: Colors.black,),
Texts('ECG',bold: true,fontSize: 22,), Texts('ECG',bold: true,fontSize: 22,),

@ -4,6 +4,7 @@ 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/patient_profile_header_with_appointment_card.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_header_with_appointment_card.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.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/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -34,22 +35,22 @@ class _LaboratoryResultPageState extends State<LaboratoryResultPage> {
orderNo: widget.patientLabOrders.orderNo, orderNo: widget.patientLabOrders.orderNo,
patient: widget.patient), patient: widget.patient),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: false, isShowAppBar: true,
// appBarTitle: TranslationBase.of(context).labResults, appBar: PatientProfileHeaderWhitAppointmentAppBar(
patient: widget.patient,
patientType: widget.patientType??"0",
arrivalType: widget.arrivalType??"0",
orderNo: widget.patientLabOrders.orderNo,
appointmentDate:widget.patientLabOrders.orderDate,
doctorName: widget.patientLabOrders.doctorName,
profileUrl: widget.patientLabOrders.doctorImageURL,
invoiceNO: widget.patientLabOrders.invoiceNo,
),
baseViewModel: model, baseViewModel: model,
body: Scaffold( body: Scaffold(
body: SingleChildScrollView( body: SingleChildScrollView(
child: Column( child: Column(
children: [ children: [
PatientProfileHeaderWhitAppointment(patient: widget.patient,
patientType: widget.patientType??"0",
arrivalType: widget.arrivalType??"0",
orderNo: widget.patientLabOrders.orderNo,
appointmentDate:widget.patientLabOrders.orderDate,
doctorName: widget.patientLabOrders.doctorName,
profileUrl: widget.patientLabOrders.doctorImageURL,
invoiceNO: widget.patientLabOrders.invoiceNo,
),
...List.generate(model.patientLabSpecialResult.length, (index) => LaboratoryResultWidget( ...List.generate(model.patientLabSpecialResult.length, (index) => LaboratoryResultWidget(
onTap: () async { onTap: () async {

@ -7,6 +7,7 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/lab_result/laboratory_result_page.dart'; import 'package:doctor_app_flutter/screens/patients/profile/lab_result/laboratory_result_page.dart';
import 'package:doctor_app_flutter/screens/procedures/add_lab_orders.dart'; import 'package:doctor_app_flutter/screens/procedures/add_lab_orders.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/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.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/app_expandable_notifier_new.dart'; import 'package:doctor_app_flutter/widgets/shared/app_expandable_notifier_new.dart';
@ -34,7 +35,8 @@ class LabsHomePage extends StatelessWidget {
onModelReady: (model) => model.getLabs(patient), onModelReady: (model) => model.getLabs(patient),
builder: (context, ProcedureViewModel model, widget) => AppScaffold( builder: (context, ProcedureViewModel model, widget) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: false, isShowAppBar: true,
appBar: PatientProfileHeaderNewDesignAppBar(patient, patient.patientType.toString() ?? '0', patientType),
body: SingleChildScrollView( body: SingleChildScrollView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
child: FractionallySizedBox( child: FractionallySizedBox(
@ -42,8 +44,6 @@ class LabsHomePage extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
PatientProfileHeaderNewDesign(patient,
patient.patientType.toString() ?? '0', patientType),
SizedBox( SizedBox(
height: 12, height: 12,
), ),

@ -6,6 +6,7 @@ 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/patient_profile_header_with_appointment_card.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_header_with_appointment_card.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.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/app_button.dart'; import 'package:doctor_app_flutter/widgets/shared/app_button.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
@ -29,25 +30,23 @@ 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(
isShowAppBar: false, patient: patient,
patientType: patientType??"0",
arrivalType: arrivalType??"0",
orderNo: finalRadiology.orderNo.toString(),
appointmentDate:finalRadiology.orderDate,
doctorName: finalRadiology.doctorName,
profileUrl: finalRadiology.doctorImageURL,
invoiceNO: finalRadiology.invoiceNo.toString(),
),
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>[
PatientProfileHeaderWhitAppointment(patient: patient,
patientType: patientType??"0",
arrivalType: arrivalType??"0",
orderNo: finalRadiology.orderNo.toString(),
appointmentDate:finalRadiology.orderDate,
doctorName: finalRadiology.doctorName,
profileUrl: finalRadiology.doctorImageURL,
invoiceNO: finalRadiology.invoiceNo.toString(),
),
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(

@ -8,6 +8,7 @@ import 'package:doctor_app_flutter/screens/patients/profile/radiology/radiology_
import 'package:doctor_app_flutter/screens/procedures/add_radiology_order.dart'; import 'package:doctor_app_flutter/screens/procedures/add_radiology_order.dart';
import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/date-utils.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/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.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/app_expandable_notifier_new.dart'; import 'package:doctor_app_flutter/widgets/shared/app_expandable_notifier_new.dart';
@ -30,16 +31,15 @@ class RadiologyHomePage extends StatelessWidget {
return BaseView<ProcedureViewModel>( return BaseView<ProcedureViewModel>(
onModelReady: (model) => model.getPatientRadOrders(patient), onModelReady: (model) => model.getPatientRadOrders(patient),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
isShowAppBar: false, isShowAppBar: true,
// appBarTitle: TranslationBase.of(context).radiology, // appBarTitle: TranslationBase.of(context).radiology,
appBar: PatientProfileHeaderNewDesignAppBar(patient, patient.patientType.toString() ?? '0', arrivalType),
baseViewModel: model, baseViewModel: model,
body: FractionallySizedBox( body: FractionallySizedBox(
widthFactor: 1.0, widthFactor: 1.0,
child: ListView( child: ListView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
children: <Widget>[ children: <Widget>[
PatientProfileHeaderNewDesign(
patient, patient.patientType.toString() ?? '0', arrivalType),
SizedBox( SizedBox(
height: 12, height: 12,
), ),

@ -1,4 +1,5 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.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/patient-referral-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
@ -9,6 +10,8 @@ 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/patient-page-header-widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart';
import 'package:doctor_app_flutter/widgets/shared/app-textfield-custom.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:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
@ -46,6 +49,8 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context).settings.arguments as Map;
patient = routeArgs['patient']; patient = routeArgs['patient'];
String patientType = routeArgs['patientType'];
String arrivalType = routeArgs['arrivalType'];
referToList = List(); referToList = List();
dynamic sameBranch = { dynamic sameBranch = {
@ -66,46 +71,69 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
appBarTitle: TranslationBase.of(context).referPatient, appBarTitle: TranslationBase.of(context).referPatient,
isShowAppBar: false,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [ children: [
/*if (model.state == ViewState.BusyLocal)
Container(
color: Colors.white,
width: 50,
height: 50,
child: AppLoaderWidget(
containerColor: Colors.white,
)),*/
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
PatientPageHeaderWidget(patient), PatientProfileHeaderNewDesign(
const Divider( patient, patientType, arrivalType),
color: Color(0xffCCCCCC), Container(
height: 1, margin: EdgeInsets.all(16.0),
thickness: 2, child: Column(
indent: 0, crossAxisAlignment: CrossAxisAlignment.start,
endIndent: 0, children: [
AppText(
"${TranslationBase.of(context).refer}",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.6,
fontWeight: FontWeight.w600,
),
AppText(
"${TranslationBase.of(context).patient}",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 3,
fontWeight: FontWeight.bold,
)
],
),
), ),
model.patientReferral.length == 0 model.patientReferral.length == 0
? ReferralForm(model, screenSize) ? referralForm(model, screenSize)
: PatientReferralItemWidget( : PatientReferralItemWidget(
"${model.patientReferral[model.patientReferral.length -1].patientID}", "${model.patientReferral[model.patientReferral.length - 1].patientID}",
patientName: model.patientReferral[model.patientReferral.length -1].patientName, patientName: model
.patientReferral[
model.patientReferral.length - 1]
.patientName,
referralStatus: referralStatus:
"${model.patientReferral[model.patientReferral.length -1].referralStatus}", "${model.patientReferral[model.patientReferral.length - 1].referralStatus}",
isReferredTo: true, isReferredTo: true,
isSameBranch: model isSameBranch: model
.patientReferral[model.patientReferral.length -1].isReferralDoctorSameBranch, .patientReferral[
referralDoctorName: model.patientReferral.length - 1]
model.patientReferral[model.patientReferral.length -1].referredByDoctorInfo, .isReferralDoctorSameBranch,
referralDoctorName: model
.patientReferral[
model.patientReferral.length - 1]
.referredByDoctorInfo,
clinicDescription: null, clinicDescription: null,
remark: model.patientReferral[model.patientReferral.length -1].remarksFromSource, remark: model
referredOn: model.patientReferral[model.patientReferral.length -1].referredOn, .patientReferral[
answerFromTarget: model.patientReferral.length - 1]
model.patientReferral[model.patientReferral.length -1].answerFromTarget, .remarksFromSource,
referredOn: model
.patientReferral[
model.patientReferral.length - 1]
.referredOn,
answerFromTarget: model
.patientReferral[
model.patientReferral.length - 1]
.answerFromTarget,
), ),
], ],
), ),
@ -114,7 +142,8 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: AppButton( child: AppButton(
title: TranslationBase.of(context).refer, title: TranslationBase.of(context).refer,
color: HexColor("#B8382B"), fontWeight: FontWeight.w700,
color: HexColor("#359846"),
onPressed: () { onPressed: () {
if (appointmentDate == null || if (appointmentDate == null ||
_selectedBranch == null || _selectedBranch == null ||
@ -145,262 +174,221 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
); );
} }
Widget ReferralForm(PatientReferralViewModel model, Size screenSize) { Widget referralForm(PatientReferralViewModel model, Size screenSize) {
return Container( return Container(
margin: EdgeInsets.symmetric(vertical: 16, horizontal: 16), margin: EdgeInsets.symmetric(vertical: 0, horizontal: 16),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox( AppTextFieldCustom(
height: 16, height: screenSize.height * 0.075,
), hintText: TranslationBase.of(context).branch,
AppText( dropDownText: _referTo != null ? _referTo['name'] : null,
TranslationBase.of(context).referPatient, enabled: false,
fontWeight: FontWeight.bold, isDropDown: true,
fontSize: 16, onClick: referToList != null
), ? () {
SizedBox( ListSelectDialog dialog = ListSelectDialog(
height: 16, list: referToList,
), attributeName: 'name',
Container( attributeValueId: 'id',
height: screenSize.height * 0.070, okText: TranslationBase.of(context).ok,
child: InkWell( okFunction: (selectedValue) {
onTap: referToList != null setState(() {
? () { _referTo = selectedValue;
ListSelectDialog dialog = ListSelectDialog( _selectedBranch = null;
list: referToList, _selectedClinic = null;
attributeName: 'name', _selectedDoctor = null;
attributeValueId: 'id', model.getDoctorBranch().then((value) async {
okText: TranslationBase.of(context).ok, _selectedBranch = value;
okFunction: (selectedValue) { if (_referTo['id'] == 1) {
setState(() { GifLoaderDialogUtils.showMyDialog(context);
_referTo = selectedValue; await model
_selectedBranch = null; .getClinics(_selectedBranch['facilityId'])
_selectedClinic = null; .then((_) =>
_selectedDoctor = null; GifLoaderDialogUtils.hideDialog(context));
model.getDoctorBranch().then((value) async { if (model.state == ViewState.ErrorLocal) {
_selectedBranch = value; DrAppToastMsg.showErrorToast(model.error);
if (_referTo['id'] == 1) {
GifLoaderDialogUtils.showMyDialog(context);
await model
.getClinics(_selectedBranch['facilityId'])
.then((_) =>
GifLoaderDialogUtils.hideDialog(
context));
if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error);
}
} }
}); } else {
_selectedBranch = null;
}
}); });
}, });
); },
showDialog( );
barrierDismissible: false, showDialog(
context: context, barrierDismissible: false,
builder: (BuildContext context) { context: context,
return dialog; builder: (BuildContext context) {
}, return dialog;
); },
} );
: null, }
child: TextField( : null,
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).referTo,
_referTo != null ? _referTo['name'] : null,
true),
enabled: false,
),
),
), ),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Container( AppTextFieldCustom(
height: screenSize.height * 0.070, height: screenSize.height * 0.075,
child: InkWell( hintText: TranslationBase.of(context).hospital,
onTap: model.branchesList != null && dropDownText: _selectedBranch != null
model.branchesList.length > 0 && ? _selectedBranch['facilityName']
_referTo != null && : null,
_referTo['id'] == 2 enabled: false,
? () { isDropDown: true,
ListSelectDialog dialog = ListSelectDialog( onClick: model.branchesList != null &&
list: model.branchesList, model.branchesList.length > 0 &&
attributeName: 'facilityName', _referTo != null &&
attributeValueId: 'facilityId', _referTo['id'] == 2
okText: TranslationBase.of(context).ok, ? () {
okFunction: (selectedValue) { ListSelectDialog dialog = ListSelectDialog(
setState(() async { list: model.branchesList,
_selectedBranch = selectedValue; attributeName: 'facilityName',
_selectedClinic = null; attributeValueId: 'facilityId',
_selectedDoctor = null; okText: TranslationBase.of(context).ok,
GifLoaderDialogUtils.showMyDialog(context); okFunction: (selectedValue) {
await model setState(() async {
.getClinics(_selectedBranch['facilityId']) _selectedBranch = selectedValue;
.then((_) => _selectedClinic = null;
GifLoaderDialogUtils.hideDialog(context)); _selectedDoctor = null;
if (model.state == ViewState.ErrorLocal) { GifLoaderDialogUtils.showMyDialog(context);
DrAppToastMsg.showErrorToast(model.error); await model
} .getClinics(_selectedBranch['facilityId'])
}); .then((_) =>
}, GifLoaderDialogUtils.hideDialog(context));
); if (model.state == ViewState.ErrorLocal) {
showDialog( DrAppToastMsg.showErrorToast(model.error);
barrierDismissible: false, }
context: context, });
builder: (BuildContext context) { },
return dialog; );
}, showDialog(
); barrierDismissible: false,
} context: context,
: null, builder: (BuildContext context) {
child: TextField( return dialog;
decoration: Helpers.textFieldSelectorDecoration( },
TranslationBase.of(context).branch, );
_selectedBranch != null }
? _selectedBranch['facilityName'] : null,
: null,
true),
enabled: false,
),
),
), ),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Container( AppTextFieldCustom(
height: screenSize.height * 0.070, height: screenSize.height * 0.075,
child: InkWell( hintText: TranslationBase.of(context).clinic,
onTap: _selectedBranch != null && dropDownText: _selectedClinic != null
model.clinicsList != null && ? _selectedClinic['ClinicDescription']
model.clinicsList.length > 0 : null,
? () { enabled: false,
ListSelectDialog dialog = ListSelectDialog( isDropDown: true,
list: model.clinicsList, onClick: _selectedBranch != null &&
attributeName: 'ClinicDescription', model.clinicsList != null &&
attributeValueId: 'ClinicID', model.clinicsList.length > 0
usingSearch: true, ? () {
hintSearchText: ListSelectDialog dialog = ListSelectDialog(
TranslationBase.of(context).clinicSearch, list: model.clinicsList,
okText: TranslationBase.of(context).ok, attributeName: 'ClinicDescription',
okFunction: (selectedValue) { attributeValueId: 'ClinicID',
setState(() async { usingSearch: true,
_selectedDoctor = null; hintSearchText: TranslationBase.of(context).clinicSearch,
_selectedClinic = selectedValue; okText: TranslationBase.of(context).ok,
GifLoaderDialogUtils.showMyDialog(context); okFunction: (selectedValue) {
await model setState(() async {
.getClinicDoctors( _selectedDoctor = null;
_selectedClinic['ClinicID'].toString()) _selectedClinic = selectedValue;
.then((_) => GifLoaderDialogUtils.showMyDialog(context);
GifLoaderDialogUtils.hideDialog(context)); await model
if (model.state == ViewState.ErrorLocal) { .getClinicDoctors(
DrAppToastMsg.showErrorToast(model.error); _selectedClinic['ClinicID'].toString())
} .then((_) =>
}); GifLoaderDialogUtils.hideDialog(context));
}, if (model.state == ViewState.ErrorLocal) {
); DrAppToastMsg.showErrorToast(model.error);
showDialog( }
barrierDismissible: false, });
context: context, },
builder: (BuildContext context) { );
return dialog; showDialog(
}, barrierDismissible: false,
); context: context,
} builder: (BuildContext context) {
: null, return dialog;
child: TextField( },
decoration: Helpers.textFieldSelectorDecoration( );
TranslationBase.of(context).clinic, }
_selectedClinic != null : null,
? _selectedClinic['ClinicDescription']
: null,
true),
enabled: false,
),
),
), ),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Container( AppTextFieldCustom(
height: screenSize.height * 0.070, height: screenSize.height * 0.075,
child: InkWell( hintText: TranslationBase.of(context).doctor,
onTap: _selectedClinic != null && dropDownText:
model.doctorsList != null && _selectedDoctor != null ? _selectedDoctor['DoctorName'] : null,
model.doctorsList.length > 0 enabled: false,
? () { isDropDown: true,
ListSelectDialog dialog = ListSelectDialog( onClick: _selectedClinic != null &&
list: model.doctorsList, model.doctorsList != null &&
attributeName: 'DoctorName', model.doctorsList.length > 0
attributeValueId: 'DoctorID', ? () {
usingSearch: true, ListSelectDialog dialog = ListSelectDialog(
hintSearchText: list: model.doctorsList,
TranslationBase.of(context).doctorSearch, attributeName: 'DoctorName',
okText: TranslationBase.of(context).ok, attributeValueId: 'DoctorID',
okFunction: (selectedValue) { usingSearch: true,
setState(() { hintSearchText: TranslationBase.of(context).doctorSearch,
_selectedDoctor = selectedValue; okText: TranslationBase.of(context).ok,
}); okFunction: (selectedValue) {
}, setState(() {
); _selectedDoctor = selectedValue;
showDialog( });
barrierDismissible: false, },
context: context, );
builder: (BuildContext context) { showDialog(
return dialog; barrierDismissible: false,
}, context: context,
); builder: (BuildContext context) {
} return dialog;
: null, },
child: TextField( );
decoration: Helpers.textFieldSelectorDecoration( }
TranslationBase.of(context).doctor, : null,
_selectedDoctor != null
? _selectedDoctor['DoctorName']
: null,
true),
enabled: false,
),
),
), ),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Container( AppTextFieldCustom(
height: screenSize.height * 0.070, height: screenSize.height * 0.075,
child: InkWell( hintText: TranslationBase.of(context).date,
onTap: () => _selectDate(context, model), dropDownText: appointmentDate != null
child: TextField( ? "${DateUtils.convertDateToFormat(appointmentDate, "yyyy-MM-dd")}"
decoration: Helpers.textFieldSelectorDecoration( : null,
TranslationBase.of(context).chooseAppointment, enabled: false,
appointmentDate != null isDropDown: true,
? "${DateUtils.convertDateToFormat(appointmentDate, "yyyy-MM-dd")}" suffixIcon: Icon(
: null, Icons.calendar_today,
true, color: Colors.black,
suffixIcon: Icon(
Icons.calendar_today,
color: Colors.black,
)),
enabled: false,
),
), ),
onClick: (){
_selectDate(context, model);
},
), ),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Container( AppTextFieldCustom(
child: TextField( hintText:
decoration: Helpers.textFieldSelectorDecoration( TranslationBase.of(context).dietTypeRemarks,
TranslationBase.of(context).remarks, null, false),
enabled: true,
controller: _remarksController, controller: _remarksController,
// inputFormatters: [ inputType: TextInputType.multiline,
// FilteringTextInputFormatter.allow(RegExp(ONLY_LETTERS))
// ],
keyboardType: TextInputType.text,
minLines: 4, minLines: 4,
maxLines: 6, maxLines: 6,
)), ),
], ],
), ),
); );

@ -8,6 +8,7 @@ import 'package:doctor_app_flutter/screens/prescription/prescription_details_pag
import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/date-utils.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/patient_profile_header_with_appointment_card.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_header_with_appointment_card.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.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/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
@ -27,23 +28,23 @@ class PrescriptionItemsPage extends StatelessWidget {
onModelReady: (model) => onModelReady: (model) =>
model.getPrescriptionReport(prescriptions: prescriptions,patient: patient), model.getPrescriptionReport(prescriptions: prescriptions,patient: patient),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
isShowAppBar: false, isShowAppBar: true,
baseViewModel: model, baseViewModel: model,
appBar: PatientProfileHeaderWhitAppointmentAppBar(
patient: patient,
patientType: patientType??"0",
arrivalType: arrivalType??"0",
branch: '',
clinic: prescriptions.clinicDescription,
isPrescriptions: true,
appointmentDate: DateUtils.getDateTimeFromServerFormat(prescriptions.appointmentDate),
doctorName: prescriptions.doctorName,
profileUrl: prescriptions.doctorImageURL,
),
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
child: Column( child: Column(
children: [ children: [
PatientProfileHeaderWhitAppointment(patient: patient,
patientType: patientType??"0",
arrivalType: arrivalType??"0",
branch: '',
clinic: prescriptions.clinicDescription,
isPrescriptions: true,
appointmentDate: DateUtils.getDateTimeFromServerFormat(prescriptions.appointmentDate),
doctorName: prescriptions.doctorName,
profileUrl: prescriptions.doctorImageURL,
// invoiceNO: widget.patientLabOrders.invoiceNo,
),
if (!prescriptions.isInOutPatient) if (!prescriptions.isInOutPatient)
...List.generate( ...List.generate(

@ -8,6 +8,7 @@ import 'package:doctor_app_flutter/screens/prescription/add_prescription_form.da
import 'package:doctor_app_flutter/screens/prescription/prescription_items_page.dart'; import 'package:doctor_app_flutter/screens/prescription/prescription_items_page.dart';
import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/date-utils.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/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.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/app_expandable_notifier_new.dart'; import 'package:doctor_app_flutter/widgets/shared/app_expandable_notifier_new.dart';
@ -30,14 +31,13 @@ class PrescriptionsPage extends StatelessWidget {
onModelReady: (model) => model.getPrescriptions(patient), onModelReady: (model) => model.getPrescriptions(patient),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: false, isShowAppBar: true,
appBar: PatientProfileHeaderNewDesignAppBar(patient, arrivalType ?? '0', patientType),
body: FractionallySizedBox( body: FractionallySizedBox(
widthFactor: 1.0, widthFactor: 1.0,
child: ListView( child: ListView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
children: <Widget>[ children: <Widget>[
PatientProfileHeaderNewDesign(
patient, arrivalType ?? '0', patientType),
SizedBox( SizedBox(
height: 12, height: 12,
), ),

@ -227,13 +227,16 @@ class PatientCard extends StatelessWidget {
"List_MyOutPatient") "List_MyOutPatient")
Container( Container(
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
AppText( Expanded(
TranslationBase.of(context) child: AppText(
.appointmentDate + TranslationBase.of(context)
" : ", .appointmentDate +
fontSize: 14, " : ",
fontSize: 14,
),
), ),
patientInfo.startTimes != null patientInfo.startTimes != null
? Container( ? Container(

@ -1,4 +1,5 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/patient/my_referral/PendingReferral.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';
@ -7,6 +8,7 @@ import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart';
import 'package:flutter/cupertino.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'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:provider/provider.dart';
class PatientReferralItemWidget extends StatelessWidget { class PatientReferralItemWidget extends StatelessWidget {
final String patientName; final String patientName;
@ -39,6 +41,8 @@ class PatientReferralItemWidget extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return Container( return Container(
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(
@ -298,7 +302,8 @@ class PatientReferralItemWidget extends StatelessWidget {
: Colors.grey[500], : Colors.grey[500],
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 2.0 * SizeConfig.textMultiplier)), fontSize:
2.0 * SizeConfig.textMultiplier)),
], ],
), ),
), ),
@ -325,15 +330,15 @@ class PatientReferralItemWidget extends StatelessWidget {
SizedBox( SizedBox(
width: 4, width: 4,
), ),
/*patient.gender*/1 == 1 /*patient.gender*/ 1 == 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,
), ),
], ],
), ),
SizedBox( SizedBox(
@ -351,7 +356,8 @@ class PatientReferralItemWidget extends StatelessWidget {
color: Colors.black), color: Colors.black),
children: <TextSpan>[ children: <TextSpan>[
new TextSpan( new TextSpan(
text: TranslationBase.of(context).fileNumber, text: TranslationBase.of(context)
.fileNumber,
style: TextStyle( style: TextStyle(
fontSize: 14, fontFamily: 'Poppins')), fontSize: 14, fontFamily: 'Poppins')),
new TextSpan( new TextSpan(
@ -371,13 +377,17 @@ class PatientReferralItemWidget extends StatelessWidget {
color: Colors.black), color: Colors.black),
children: <TextSpan>[ children: <TextSpan>[
new TextSpan( new TextSpan(
text: TranslationBase.of(context).referredFrom, text: TranslationBase.of(context)
.referredFrom,
style: TextStyle( style: TextStyle(
fontSize: 14, fontFamily: 'Poppins')), fontSize: 14,
fontFamily: 'Poppins')),
new TextSpan( new TextSpan(
text: isSameBranch text: isSameBranch
? TranslationBase.of(context).sameBranch ? TranslationBase.of(context)
: TranslationBase.of(context).otherBranch, .sameBranch
: TranslationBase.of(context)
.otherBranch,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontFamily: 'Poppins', fontFamily: 'Poppins',
@ -392,11 +402,12 @@ class PatientReferralItemWidget extends StatelessWidget {
children: [ children: [
AppText( AppText(
/*patient.nationalityName ?? /*patient.nationalityName ??
patient.nationality*/ "Saudi", patient.nationality*/
"Saudi",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 12, fontSize: 12,
), ),
/* patient.nationality != null /* patient.nationality != null
? ClipRRect( ? ClipRRect(
borderRadius: borderRadius:
BorderRadius BorderRadius
@ -418,7 +429,7 @@ class PatientReferralItemWidget extends StatelessWidget {
'No Image'); 'No Image');
}, },
))*/ ))*/
/*:*/ SizedBox() /*:*/ SizedBox()
], ],
) )
], ],
@ -445,32 +456,56 @@ class PatientReferralItemWidget extends StatelessWidget {
), ),
), ),
), ),
SizedBox( Row(
height: 20, crossAxisAlignment: CrossAxisAlignment.start,
),
Column(
children: [ children: [
RichText( Container(
text: TextSpan( width: 30,
style: TextStyle( height: 30,
fontSize: 2.0 * SizeConfig.textMultiplier, margin: EdgeInsets.only(
color: Colors.black), left: projectViewModel.isArabic ? 10 : 10 /*10:85*/,
children: <TextSpan>[ right: projectViewModel.isArabic ? 10 : 10 /*85:10*/,
TextSpan( top: 5),
text: TranslationBase.of(context) decoration: BoxDecoration(
.referralDoctor + shape: BoxShape.rectangle,
" : ", border: Border(
style: TextStyle( bottom:
fontSize: 14, fontFamily: 'Poppins')), BorderSide(color: Colors.grey[400], width: 2.5),
TextSpan( left:
text: referralDoctorName, BorderSide(color: Colors.grey[400], width: 2.5),
style: TextStyle( )),
fontWeight: FontWeight.w700, ),
fontFamily: 'Poppins', Expanded(
fontSize: 15)), flex: 4,
], child: Container(
margin: EdgeInsets.only(left: 10, top: 25, right : 10, bottom: 0),
child: Column(
children: [
RichText(
text: TextSpan(
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',
fontSize: 15)),
],
),
)
],
),
), ),
) ),
], ],
), ),
Container( Container(

@ -0,0 +1,359 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/util/date-utils.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/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:intl/intl.dart';
class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with PreferredSizeWidget{
final PatiantInformtion patient;
final String patientType;
final String arrivalType;
PatientProfileHeaderNewDesignAppBar(this.patient, this.patientType, this.arrivalType);
@override
Widget build(BuildContext context) {
return PreferredSize(
preferredSize: Size(double.infinity, 200),
child: Container(
padding: EdgeInsets.only(
left: 0, right: 5, bottom: 5,),
decoration: BoxDecoration(
color: Colors.white,
),
height: 200,
child: Container(
padding: EdgeInsets.only(
left: 10, right: 10, bottom: 10),
margin: EdgeInsets.only(top: 50),
child: 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),
),
AppText(
(Helpers.capitalize(patient.firstName) +
" " +
Helpers.capitalize(
patient.lastName)),
fontSize: SizeConfig.textMultiplier * 3,
fontWeight: FontWeight.bold,
backGroundcolor: Colors.white,
fontFamily: 'Poppins',
),
patient.gender == 1
? Icon(
DoctorApp.male_2,
color: Colors.blue,
)
: Icon(
DoctorApp.female_1,
color: Colors.pink,
),
]),
),
Row(children: [
Padding(
padding: EdgeInsets.only(left: 12.0),
child: Container(
width: 60,
height: 60,
child: Image.asset(
patient.gender == 1
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
fit: BoxFit.cover,
),
),
),
SizedBox(
width: 10,
),
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
SERVICES_PATIANT2[
int.parse(patientType)] ==
"patientArrivalList"
? Container(
child: Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
children: [
patient.patientStatusType ==
43
? AppText(
TranslationBase.of(
context)
.arrivedP,
color: Colors.green,
fontWeight:
FontWeight.bold,
fontFamily:
'Poppins',
fontSize: 12,
)
: AppText(
TranslationBase.of(
context)
.notArrived,
color:
Colors.red[800],
fontWeight:
FontWeight.bold,
fontFamily:
'Poppins',
fontSize: 12,
),
arrivalType == '1'
? AppText(
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(),
if (SERVICES_PATIANT2[
int.parse(patientType)] ==
"List_MyOutPatient")
Container(
child: Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context)
.appointmentDate +
" : ",
fontSize: 14,
),
patient.startTime != null
? Container(
height: 15,
width: 60,
decoration:
BoxDecoration(
borderRadius:
BorderRadius
.circular(
25),
color: HexColor(
"#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(
convertDateFormat2(patient.appointmentDate.toString()?? ''),
fontSize: 1.5 *
SizeConfig
.textMultiplier,
fontWeight:
FontWeight.bold,
),
),
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>[
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)),
],
),
),
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.dateofBirth, context)}",
style: TextStyle(
fontWeight:
FontWeight.w700,
fontSize: 14)),
],
),
),
),
],
),
),
]),
],
),
),
),
);
}
convertDateFormat2(String str) {
String newDate;
const start = "/Date(";
if (str.isNotEmpty) {
const end = "+0300)";
final startIndex = str.indexOf(start);
final endIndex = str.indexOf(end, startIndex + start.length);
var date = new DateTime.fromMillisecondsSinceEpoch(
int.parse(str.substring(startIndex + start.length, endIndex)));
newDate = date.year.toString() +
"/" +
date.month.toString().padLeft(2, '0') +
"/" +
date.day.toString().padLeft(2, '0');
}
return newDate.toString();
}
isToday(date) {
DateTime tempDate = new DateFormat("yyyy-MM-dd").parse(date);
return DateFormat("yyyy-MM-dd").format(tempDate) ==
DateFormat("yyyy-MM-dd").format(DateTime.now());
}
myBoxDecoration() {
return BoxDecoration(
border: Border(
top: BorderSide(
color: Colors.green,
width: 5,
),
),
borderRadius: BorderRadius.circular(10));
}
@override
Size get preferredSize => Size(double.maxFinite,200);
}

@ -0,0 +1,498 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/util/date-utils.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/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:intl/intl.dart';
import 'package:provider/provider.dart';
import 'large_avatar.dart';
class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget with PreferredSizeWidget {
final PatiantInformtion patient;
final String patientType;
final String arrivalType;
final String doctorName;
final String branch;
final DateTime appointmentDate;
final String profileUrl;
final String invoiceNO;
final String orderNo;
final bool isPrescriptions;
final String clinic;
PatientProfileHeaderWhitAppointmentAppBar(
{this.patient,
this.patientType,
this.arrivalType,
this.doctorName,
this.branch,
this.appointmentDate,
this.profileUrl,
this.invoiceNO,
this.orderNo, this.isPrescriptions = false, this.clinic});
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return Container(
padding: EdgeInsets.only(
left: 0, right: 5, bottom: 5, top: 5),
decoration: BoxDecoration(
color: Colors.white,
),
//height: 300,
child: Container(
padding: EdgeInsets.only(left: 10, right: 10, bottom: 10),
margin: EdgeInsets.only(top: 50),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
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),
),
AppText(
(Helpers.capitalize(patient.firstName) +
" " +
Helpers.capitalize(
patient.lastName)),
fontSize: SizeConfig.textMultiplier * 3,
fontWeight: FontWeight.bold,
backGroundcolor: Colors.white,
fontFamily: 'Poppins',
),
patient.gender == 1
? Icon(
DoctorApp.male_2,
color: Colors.blue,
)
: Icon(
DoctorApp.female_1,
color: Colors.pink,
),
]),
),
Row(children: [
Padding(
padding: EdgeInsets.only(left: 12.0),
child: Container(
width: 60,
height: 60,
child: Image.asset(
patient.gender == 1
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
fit: BoxFit.cover,
),
),
),
SizedBox(
width: 10,
),
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
SERVICES_PATIANT2[
int.parse(patientType)] ==
"patientArrivalList"
? Container(
child: Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
children: [
patient.patientStatusType ==
43
? AppText(
TranslationBase.of(
context)
.arrivedP,
color: Colors.green,
fontWeight:
FontWeight.bold,
fontFamily:
'Poppins',
fontSize: 12,
)
: AppText(
TranslationBase.of(
context)
.notArrived,
color:
Colors.red[800],
fontWeight:
FontWeight.bold,
fontFamily:
'Poppins',
fontSize: 12,
),
arrivalType == '1'
? AppText(
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(),
if (SERVICES_PATIANT2[
int.parse(patientType)] ==
"List_MyOutPatient")
Container(
child: Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context)
.appointmentDate +
" : ",
fontSize: 14,
),
patient.startTime != null
? Container(
height: 15,
width: 60,
decoration:
BoxDecoration(
borderRadius:
BorderRadius
.circular(
25),
color: HexColor(
"#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(
convertDateFormat2(patient.appointmentDate??''),
fontSize: 1.5 *
SizeConfig
.textMultiplier,
fontWeight:
FontWeight.bold,
),
),
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>[
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)),
],
),
),
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.dateofBirth, context)}",
style: TextStyle(
fontWeight:
FontWeight.w700,
fontSize: 14)),
],
),
),
),
],
),
),
]),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: 30,
height: 30,
margin: EdgeInsets.only(left: projectViewModel.isArabic?10:85, right: projectViewModel.isArabic?85:10,top: 5),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
border: Border(
bottom:BorderSide(color: Colors.grey[400],width: 2.5),
left: BorderSide(color: Colors.grey[400],width: 2.5),
)
),
),
Expanded(
child: Container(
margin: EdgeInsets.only(top: 10),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
child: LargeAvatar(
name: doctorName,
url: profileUrl,
),
width: 25,
height: 25,
margin: EdgeInsets.only(top: 10),
),
Expanded(
flex: 4,
child: Container(
margin: EdgeInsets.all(10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Texts(
'${TranslationBase.of(context).dr}$doctorName',
color: Colors.black,
fontWeight: FontWeight.w600,
fontSize: 14,
),
if (orderNo != null && !isPrescriptions)
Row(
children: <Widget>[
Texts(
'Order No: ',
color: Colors.grey[800],
fontSize: 14
),
Texts(
orderNo ?? '',fontSize: 14
)
],
),
if (invoiceNO != null && !isPrescriptions)
Row(
children: <Widget>[
Texts(
'Invoice: ',
color: Colors.grey[800],
fontSize: 14
),
Texts(
invoiceNO,
fontSize: 14
)
],
),
if(isPrescriptions)
Row(
children: [
Texts(
'Branch: ',
color: Colors.grey[800],
fontSize: 14
),
Texts(
branch?? '',
fontSize: 14
)
],
),
if(isPrescriptions)
Row(
children: [
Texts(
'Clinic: ',
color: Colors.grey[800],
fontSize: 14
),
Texts(
clinic?? '',
fontSize: 14
)
],
),
Row(
children: <Widget>[
Texts(
!isPrescriptions? 'Result Date: ': 'Prescriptions Date ',
color: Colors.grey[800],
fontSize: 14,
),
Expanded(
child: Texts(
'${DateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}',fontSize: 14,
),
)
],
)
]),
),
),
],
),
),
),
],
)
],
),
),
);
}
convertDateFormat2(String str) {
String newDate ="";
const start = "/Date(";
const end = "+0300)";
if (str.isNotEmpty) {
final startIndex = str.indexOf(start);
final endIndex = str.indexOf(end, startIndex + start.length);
var date = new DateTime.fromMillisecondsSinceEpoch(
int.parse(str.substring(startIndex + start.length, endIndex)));
newDate = date.year.toString() +
"/" +
date.month.toString().padLeft(2, '0') +
"/" +
date.day.toString().padLeft(2, '0');
}
return newDate.toString();
}
isToday(date) {
DateTime tempDate = new DateFormat("yyyy-MM-dd").parse(date);
return DateFormat("yyyy-MM-dd").format(tempDate) ==
DateFormat("yyyy-MM-dd").format(DateTime.now());
}
myBoxDecoration() {
return BoxDecoration(
border: Border(
top: BorderSide(
color: Colors.green,
width: 5,
),
),
borderRadius: BorderRadius.circular(10));
}
@override
Size get preferredSize => Size(double.maxFinite,270);
}

@ -19,12 +19,13 @@ class AppScaffold extends StatelessWidget {
final BaseViewModel baseViewModel; final BaseViewModel baseViewModel;
final Widget bottomSheet; final Widget bottomSheet;
final Color backgroundColor; final Color backgroundColor;
final Widget appBar;
AppScaffold( AppScaffold(
{this.appBarTitle = '', {this.appBarTitle = '',
this.body, this.body,
this.isLoading = false, this.isLoading = false,
this.isShowAppBar = true, this.isShowAppBar = true,
this.baseViewModel, this.bottomSheet, this.backgroundColor}); this.baseViewModel, this.bottomSheet, this.backgroundColor, this.appBar});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -37,7 +38,7 @@ class AppScaffold extends StatelessWidget {
child: Scaffold( child: Scaffold(
backgroundColor: backgroundColor??Colors.white, backgroundColor: backgroundColor??Colors.white,
appBar: isShowAppBar appBar: isShowAppBar
? AppBar( ? appBar ?? AppBar(
elevation: 0, elevation: 0,
backgroundColor: HexColor('#515B5D'), backgroundColor: HexColor('#515B5D'),
textTheme: TextTheme(headline6: TextStyle(color: Colors.white)), textTheme: TextTheme(headline6: TextStyle(color: Colors.white)),

@ -127,7 +127,7 @@ class DoctorCard extends StatelessWidget {
Row( Row(
children: <Widget>[ children: <Widget>[
Texts( Texts(
'Clinic:', 'Clinic: ',
color: Colors.grey[500], color: Colors.grey[500],
), ),
Texts( Texts(
@ -139,7 +139,7 @@ class DoctorCard extends StatelessWidget {
Row( Row(
children: <Widget>[ children: <Widget>[
Texts( Texts(
'Branch:', 'Branch: ',
color: Colors.grey[500], color: Colors.grey[500],
), ),
Texts( Texts(
@ -151,7 +151,7 @@ class DoctorCard extends StatelessWidget {
), ),
), ),
Icon( Icon(
isPrescriptions? Icons.arrow_forward: EvaIcons.eye, EvaIcons.eye,
) )
], ],
), ),

Loading…
Cancel
Save