add translation to ER service

merge-update-with-lab-changes
Mohammad Aljammal 5 years ago
parent 200334d8f8
commit 4457b5f109

@ -1477,5 +1477,8 @@ const Map localizedValues = {
"en": "Request ID:", "en": "Request ID:",
"ar": " رقم الطلب" "ar": " رقم الطلب"
}, },
"RRT-orders-log": {
"en": "Orders Log",
"ar": "سجل الطلبات"
},
}; };

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
enum Ambulate { Wheelchair, Walker, Stretcher, None } enum Ambulate { Wheelchair, Walker, Stretcher, None }
@ -6,19 +7,19 @@ extension SelectedAmbulate on Ambulate {
String getAmbulateTitle(BuildContext context) { String getAmbulateTitle(BuildContext context) {
switch (this) { switch (this) {
case Ambulate.Wheelchair: case Ambulate.Wheelchair:
return 'Wheelchair'; return TranslationBase.of(context).wheelchair;
break; break;
case Ambulate.Walker: case Ambulate.Walker:
return 'Walker'; return TranslationBase.of(context).walker;
break; break;
case Ambulate.Stretcher: case Ambulate.Stretcher:
return 'Stretcher'; return TranslationBase.of(context).stretcher;
break; break;
case Ambulate.None: case Ambulate.None:
return 'None'; return TranslationBase.of(context).none;
break; break;
} }
return 'None'; return TranslationBase.of(context).none;
} }
int selectAmbulateNumber() { int selectAmbulateNumber() {

@ -107,7 +107,7 @@ class _AmbulanceReqState extends State<AmbulanceReq>
Container( Container(
width: MediaQuery.of(context).size.width * 0.30, width: MediaQuery.of(context).size.width * 0.30,
child: Center( child: Center(
child: Texts("Orders Log"), child: Texts(TranslationBase.of(context).ordersLog),
), ),
), ),
], ],

@ -46,7 +46,7 @@ class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
body: false body: widget.amRequestViewModel.pickUpRequestPresOrder != null
? Column( ? Column(
children: [ children: [
SizedBox( SizedBox(

@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/pages/Blood/new_text_Field.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -45,7 +46,10 @@ class _BillAmountState extends State<BillAmount> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SingleChildScrollView( return AppScaffold(
isShowDecPage: false,
isShowAppBar: false,
body: SingleChildScrollView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
child: Container( child: Container(
margin: EdgeInsets.only(left: 12, right: 12), margin: EdgeInsets.only(left: 12, right: 12),
@ -201,7 +205,6 @@ class _BillAmountState extends State<BillAmount> {
leading: Radio( leading: Radio(
value: Ambulate.Wheelchair, value: Ambulate.Wheelchair,
groupValue: _ambulate, groupValue: _ambulate,
activeColor: Colors.red[800],
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
_ambulate = value; _ambulate = value;
@ -232,7 +235,7 @@ class _BillAmountState extends State<BillAmount> {
leading: Radio( leading: Radio(
value: Ambulate.Walker, value: Ambulate.Walker,
groupValue: _ambulate, groupValue: _ambulate,
activeColor: Colors.red[800],
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
_ambulate = value; _ambulate = value;
@ -268,7 +271,7 @@ class _BillAmountState extends State<BillAmount> {
leading: Radio( leading: Radio(
value: Ambulate.Stretcher, value: Ambulate.Stretcher,
groupValue: _ambulate, groupValue: _ambulate,
activeColor: Colors.red[800],
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
_ambulate = value; _ambulate = value;
@ -299,7 +302,7 @@ class _BillAmountState extends State<BillAmount> {
leading: Radio( leading: Radio(
value: Ambulate.None, value: Ambulate.None,
groupValue: _ambulate, groupValue: _ambulate,
activeColor: Colors.red[800],
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
_ambulate = value; _ambulate = value;
@ -326,10 +329,14 @@ class _BillAmountState extends State<BillAmount> {
SizedBox( SizedBox(
height: 15, height: 15,
), ),
Container( ],
),
),
),
bottomSheet: Container(
padding: EdgeInsets.all(15), padding: EdgeInsets.all(15),
width: double.maxFinite, width: double.maxFinite,
height: 76, height: 90,
child: SecondaryButton( child: SecondaryButton(
color: Colors.grey[800], color: Colors.grey[800],
textColor: Colors.white, textColor: Colors.white,
@ -343,9 +350,6 @@ class _BillAmountState extends State<BillAmount> {
}, },
label: TranslationBase.of(context).next, label: TranslationBase.of(context).next,
), ),
)
],
),
), ),
); );
} }

@ -5,23 +5,20 @@ import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.da
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/pages/Blood/dialogs/SelectHospitalDialog.dart'; import 'package:diplomaticquarterapp/pages/Blood/dialogs/SelectHospitalDialog.dart';
import 'package:diplomaticquarterapp/pages/ErService/widgets/AppointmentCard.dart'; import 'package:diplomaticquarterapp/pages/ErService/widgets/AppointmentCard.dart';
import 'package:diplomaticquarterapp/pages/landing/home_page.dart';
import 'package:diplomaticquarterapp/uitl/ProgressDialog.dart'; import 'package:diplomaticquarterapp/uitl/ProgressDialog.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/pickupLocation/PickupLocationFromMap.dart'; import 'package:diplomaticquarterapp/widgets/pickupLocation/PickupLocationFromMap.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.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:geolocator/geolocator.dart'; import 'package:geolocator/geolocator.dart';
import 'package:google_maps_place_picker/google_maps_place_picker.dart'; import 'package:google_maps_place_picker/google_maps_place_picker.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import '../AmbulanceReq.dart';
import '../AvailableAppointmentsPage.dart'; import '../AvailableAppointmentsPage.dart';
enum HaveAppointment { YES, NO } enum HaveAppointment { YES, NO }
@ -68,7 +65,10 @@ class _PickupLocationState extends State<PickupLocation> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SingleChildScrollView( return AppScaffold(
isShowAppBar: false,
isShowDecPage: false,
body: SingleChildScrollView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
child: Container( child: Container(
margin: EdgeInsets.only(left: 12, right: 12), margin: EdgeInsets.only(left: 12, right: 12),
@ -84,7 +84,7 @@ class _PickupLocationState extends State<PickupLocation> {
height: 15, height: 15,
), ),
InkWell( InkWell(
onTap: (){ onTap: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
@ -111,7 +111,7 @@ class _PickupLocationState extends State<PickupLocation> {
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Texts(getSelectFromMapName(context)), Expanded(child: Texts(getSelectFromMapName(context))),
Icon( Icon(
FontAwesomeIcons.mapMarkerAlt, FontAwesomeIcons.mapMarkerAlt,
size: 24, size: 24,
@ -144,7 +144,6 @@ class _PickupLocationState extends State<PickupLocation> {
child: ListTile( child: ListTile(
title: Texts(TranslationBase.of(context).insideHome), title: Texts(TranslationBase.of(context).insideHome),
leading: Checkbox( leading: Checkbox(
activeColor: Colors.red[800],
value: _isInsideHome, value: _isInsideHome,
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
@ -187,7 +186,6 @@ class _PickupLocationState extends State<PickupLocation> {
leading: Radio( leading: Radio(
value: HaveAppointment.YES, value: HaveAppointment.YES,
groupValue: _haveAppointment, groupValue: _haveAppointment,
activeColor: Colors.red[800],
onChanged: (value) { onChanged: (value) {
if (myAppointment == null) { if (myAppointment == null) {
getAppointment(); getAppointment();
@ -222,7 +220,6 @@ class _PickupLocationState extends State<PickupLocation> {
leading: Radio( leading: Radio(
value: HaveAppointment.NO, value: HaveAppointment.NO,
groupValue: _haveAppointment, groupValue: _haveAppointment,
activeColor: Colors.red[800],
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
_haveAppointment = value; _haveAppointment = value;
@ -271,7 +268,8 @@ class _PickupLocationState extends State<PickupLocation> {
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Texts(getHospitalName(TranslationBase.of(context).pickupLocation)), Texts(getHospitalName(
TranslationBase.of(context).pickupLocation)),
Icon( Icon(
Icons.arrow_drop_down, Icons.arrow_drop_down,
size: 24, size: 24,
@ -307,7 +305,8 @@ class _PickupLocationState extends State<PickupLocation> {
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Texts(getHospitalName(TranslationBase.of(context).pickupLocation)), Texts(getHospitalName(
TranslationBase.of(context).pickupLocation)),
Icon( Icon(
Icons.arrow_drop_down, Icons.arrow_drop_down,
size: 24, size: 24,
@ -352,7 +351,7 @@ class _PickupLocationState extends State<PickupLocation> {
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Texts(getSelectFromMapName(context)), Expanded(child: Texts(getSelectFromMapName(context))),
Icon( Icon(
FontAwesomeIcons.mapMarkerAlt, FontAwesomeIcons.mapMarkerAlt,
size: 24, size: 24,
@ -364,14 +363,18 @@ class _PickupLocationState extends State<PickupLocation> {
), ),
], ],
), ),
SizedBox( SizedBox(
height: 45, height: 45,
), ),
Container(
],
),
),
),
bottomSheet: Container(
padding: EdgeInsets.all(15), padding: EdgeInsets.all(15),
width: double.maxFinite, width: double.maxFinite,
height: 76, height: 90,
child: SecondaryButton( child: SecondaryButton(
color: Colors.grey[800], color: Colors.grey[800],
textColor: Colors.white, textColor: Colors.white,
@ -383,37 +386,61 @@ class _PickupLocationState extends State<PickupLocation> {
setState(() { setState(() {
widget.patientER.pickupSpot = _isInsideHome ? 1 : 0; widget.patientER.pickupSpot = _isInsideHome ? 1 : 0;
if (widget.patientER.direction == 0) { if (widget.patientER.direction == 0) {
widget.patientER.pickupLocationLattitude = _result.geometry.location.lat.toString(); widget.patientER.pickupLocationLattitude =
widget.patientER.pickupLocationLongitude = _result.geometry.location.lng.toString(); _result.geometry.location.lat.toString();
widget.patientER.dropoffLocationLattitude = _selectedHospital.latitude; widget.patientER.pickupLocationLongitude =
widget.patientER.dropoffLocationLongitude = _selectedHospital.longitude; _result.geometry.location.lng.toString();
widget.patientER.dropoffLocationLattitude =
_selectedHospital.latitude;
widget.patientER.dropoffLocationLongitude =
_selectedHospital.longitude;
} else { } else {
widget.patientER.pickupLocationLattitude = _selectedHospital.latitude; widget.patientER.pickupLocationLattitude =
widget.patientER.pickupLocationLongitude = _selectedHospital.longitude; _selectedHospital.latitude;
widget.patientER.dropoffLocationLattitude = _result.geometry.location.lat.toString(); widget.patientER.pickupLocationLongitude =
widget.patientER.dropoffLocationLongitude = _result.geometry.location.lng.toString(); _selectedHospital.longitude;
widget.patientER.dropoffLocationLattitude =
_result.geometry.location.lat.toString();
widget.patientER.dropoffLocationLongitude =
_result.geometry.location.lng.toString();
} }
widget.patientER.latitude = widget.patientER.pickupLocationLattitude; widget.patientER.latitude =
widget.patientER.longitude = widget.patientER.pickupLocationLongitude; widget.patientER.pickupLocationLattitude;
widget.patientER.dropoffLocationName = _selectedHospital.name; widget.patientER.longitude =
widget.patientER.createdBy = widget.amRequestViewModel.user.patientID; widget.patientER.pickupLocationLongitude;
widget.patientER.isOutPatient = widget.amRequestViewModel.user.outSA; widget.patientER.dropoffLocationName =
widget.patientER.patientIdentificationID = widget.amRequestViewModel.user.patientIdentificationNo; _selectedHospital.name;
widget.patientER.pickupDateTime = DateUtil.convertDateToStringLocation(DateTime.now()); widget.patientER.createdBy =
widget.patientER.pickupLocationName = _result.formattedAddress; widget.amRequestViewModel.user.patientID;
widget.patientER.projectID = widget.amRequestViewModel.user.projectID; widget.patientER.isOutPatient =
widget.patientER.requesterFileNo = widget.amRequestViewModel.user.patientID; widget.amRequestViewModel.user.outSA;
widget.patientER.patientIdentificationID = widget
.amRequestViewModel.user.patientIdentificationNo;
widget.patientER.pickupDateTime =
DateUtil.convertDateToStringLocation(DateTime.now());
widget.patientER.pickupLocationName =
_result.formattedAddress;
widget.patientER.projectID =
widget.amRequestViewModel.user.projectID;
widget.patientER.requesterFileNo =
widget.amRequestViewModel.user.patientID;
widget.patientER.requesterIsOutSA = false; widget.patientER.requesterIsOutSA = false;
widget.patientER.lineItemNo =0; widget.patientER.lineItemNo = 0;
widget.patientER.requesterMobileNo = widget.amRequestViewModel.user.mobileNumber; widget.patientER.requesterMobileNo =
widget.amRequestViewModel.user.mobileNumber;
if (_haveAppointment == HaveAppointment.YES) { if (_haveAppointment == HaveAppointment.YES) {
widget.patientER.appointmentNo = myAppointment.appointmentNo.toString(); widget.patientER.appointmentNo =
widget.patientER.appointmentClinicName = myAppointment.clinicName; myAppointment.appointmentNo.toString();
widget.patientER.appointmentDoctorName = myAppointment.doctorNameObj; widget.patientER.appointmentClinicName =
widget.patientER.appointmentBranch = myAppointment.projectName; myAppointment.clinicName;
widget.patientER.appointmentTime = myAppointment.appointmentDate; widget.patientER.appointmentDoctorName =
myAppointment.doctorNameObj;
widget.patientER.appointmentBranch =
myAppointment.projectName;
widget.patientER.appointmentTime =
myAppointment.appointmentDate;
widget.patientER.haveAppointment = true; widget.patientER.haveAppointment = true;
} else { } else {
widget.patientER.appointmentNo = "0"; widget.patientER.appointmentNo = "0";
@ -430,9 +457,6 @@ class _PickupLocationState extends State<PickupLocation> {
}, },
label: TranslationBase.of(context).next, label: TranslationBase.of(context).next,
), ),
)
],
),
), ),
); );
} }
@ -457,11 +481,13 @@ class _PickupLocationState extends State<PickupLocation> {
} }
String getSelectFromMapName(context) { String getSelectFromMapName(context) {
return _result != null ? _result.formattedAddress : TranslationBase.of(context).selectMap; return _result != null
? _result.formattedAddress
: TranslationBase.of(context).selectMap;
} }
getAppointment() { getAppointment() {
ProgressDialogUtil.showProgressDialog(context); GifLoaderDialogUtils.showMyDialog(context);
widget.amRequestViewModel.getAppointmentHistory().then((value) { widget.amRequestViewModel.getAppointmentHistory().then((value) {
if (widget.amRequestViewModel.state == ViewState.Error || if (widget.amRequestViewModel.state == ViewState.Error ||
widget.amRequestViewModel.state == ViewState.ErrorLocal) { widget.amRequestViewModel.state == ViewState.ErrorLocal) {
@ -469,7 +495,7 @@ class _PickupLocationState extends State<PickupLocation> {
} else if (widget } else if (widget
.amRequestViewModel.appoitmentAllHistoryResultList.length > .amRequestViewModel.appoitmentAllHistoryResultList.length >
0) { 0) {
ProgressDialogUtil.hideProgressDialog(context); GifLoaderDialogUtils.hideDialog(context);
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
@ -491,14 +517,15 @@ class _PickupLocationState extends State<PickupLocation> {
} }
}); });
} else { } else {
ProgressDialogUtil.hideProgressDialog(context); GifLoaderDialogUtils.hideDialog(context);
setState(() { setState(() {
_haveAppointment = HaveAppointment.NO; _haveAppointment = HaveAppointment.NO;
}); });
AppToast.showErrorToast(message: TranslationBase.of(context).noAppointment); AppToast.showErrorToast(
message: TranslationBase.of(context).noAppointment);
} }
}).catchError((e) { }).catchError((e) {
ProgressDialogUtil.hideProgressDialog(context); GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: e); AppToast.showErrorToast(message: e);
}); });
} }

@ -1,15 +1,15 @@
import 'package:diplomaticquarterapp/core/enum/OrderService.dart'; import 'package:diplomaticquarterapp/core/enum/OrderService.dart';
import 'package:diplomaticquarterapp/core/enum/OrderService.dart';
import 'package:diplomaticquarterapp/core/enum/OrderService.dart';
import 'package:diplomaticquarterapp/core/enum/OrderService.dart';
import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; import 'package:diplomaticquarterapp/core/model/er/PatientER.dart';
import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method_list_model.dart'; import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method_list_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
enum Direction { ToHospital, FromHospital } enum Direction { ToHospital, FromHospital }
enum Way { OneWay, TwoWays } enum Way { OneWay, TwoWays }
@ -58,7 +58,11 @@ class _SelectTransportationMethodState
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SingleChildScrollView( ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
isShowAppBar: false,
isShowDecPage: false,
body: SingleChildScrollView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
child: Container( child: Container(
margin: EdgeInsets.only(left: 12, right: 12), margin: EdgeInsets.only(left: 12, right: 12),
@ -91,13 +95,15 @@ class _SelectTransportationMethodState
Expanded( Expanded(
flex: 3, flex: 3,
child: ListTile( child: ListTile(
title: Text(widget.amRequestViewModel title: Texts(projectViewModel.isArabic
? widget.amRequestViewModel
.amRequestModeList[index].titleAR
: widget.amRequestViewModel
.amRequestModeList[index].title), .amRequestModeList[index].title),
leading: Radio( leading: Radio(
value: widget value: widget
.amRequestViewModel.amRequestModeList[index], .amRequestViewModel.amRequestModeList[index],
groupValue: _erTransportationMethod, groupValue: _erTransportationMethod,
activeColor: Colors.red[800],
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
_erTransportationMethod = value; _erTransportationMethod = value;
@ -108,8 +114,8 @@ class _SelectTransportationMethodState
), ),
Expanded( Expanded(
flex: 1, flex: 1,
child: Texts( child: Texts(TranslationBase.of(context).sar +
TranslationBase.of(context).sar+' ${widget.amRequestViewModel.amRequestModeList[index].price}'), ' ${widget.amRequestViewModel.amRequestModeList[index].price}'),
) )
], ],
), ),
@ -145,11 +151,10 @@ class _SelectTransportationMethodState
color: Colors.white, color: Colors.white,
), ),
child: ListTile( child: ListTile(
title: Text(TranslationBase.of(context).toHospital), title: Texts(TranslationBase.of(context).toHospital),
leading: Radio( leading: Radio(
value: Direction.ToHospital, value: Direction.ToHospital,
groupValue: _direction, groupValue: _direction,
activeColor: Colors.red[800],
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
_direction = value; _direction = value;
@ -176,11 +181,11 @@ class _SelectTransportationMethodState
color: Colors.white, color: Colors.white,
), ),
child: ListTile( child: ListTile(
title: Text(TranslationBase.of(context).fromHospital), title:
Texts(TranslationBase.of(context).fromHospital),
leading: Radio( leading: Radio(
value: Direction.FromHospital, value: Direction.FromHospital,
groupValue: _direction, groupValue: _direction,
activeColor: Colors.red[800],
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
_direction = value; _direction = value;
@ -223,11 +228,11 @@ class _SelectTransportationMethodState
color: Colors.white, color: Colors.white,
), ),
child: ListTile( child: ListTile(
title: Text(TranslationBase.of(context).oneDirec), title:
Texts(TranslationBase.of(context).oneDirec),
leading: Radio( leading: Radio(
value: Way.OneWay, value: Way.OneWay,
groupValue: _way, groupValue: _way,
activeColor: Colors.red[800],
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
_way = value; _way = value;
@ -254,11 +259,11 @@ class _SelectTransportationMethodState
color: Colors.white, color: Colors.white,
), ),
child: ListTile( child: ListTile(
title: Text(TranslationBase.of(context).twoDirec), title:
Texts(TranslationBase.of(context).twoDirec),
leading: Radio( leading: Radio(
value: Way.TwoWays, value: Way.TwoWays,
groupValue: _way, groupValue: _way,
activeColor: Colors.red[800],
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
_way = value; _way = value;
@ -276,34 +281,45 @@ class _SelectTransportationMethodState
SizedBox( SizedBox(
height: 15, height: 15,
), ),
Container( ],
),
),
),
bottomSheet: Container(
padding: EdgeInsets.all(15), padding: EdgeInsets.all(15),
width: double.maxFinite, width: double.maxFinite,
height: 76, height: 90,
child: SecondaryButton( child: SecondaryButton(
color: Colors.grey[800], color: Colors.grey[800],
textColor: Colors.white, textColor: Colors.white,
onTap: () { onTap: () {
setState(() { setState(() {
widget.patientER.transportationMethodId =(widget.amRequestViewModel.amRequestModeList.indexOf(_erTransportationMethod) + 1); widget.patientER.transportationMethodId = (widget
widget.patientER.direction = _direction == Direction.ToHospital ? 1 : 0; .amRequestViewModel.amRequestModeList
.indexOf(_erTransportationMethod) +
1);
widget.patientER.direction =
_direction == Direction.ToHospital ? 1 : 0;
widget.patientER.tripType = _way == Way.TwoWays ? 0 : 1; widget.patientER.tripType = _way == Way.TwoWays ? 0 : 1;
widget.patientER.selectedAmbulate = (widget.amRequestViewModel.amRequestModeList.indexOf(_erTransportationMethod) + 1); widget.patientER.selectedAmbulate = (widget
widget.patientER.patientERTransportationMethod = _erTransportationMethod; .amRequestViewModel.amRequestModeList
widget.patientER.orderServiceID = _orderService.getIdOrderService(); .indexOf(_erTransportationMethod) +
1);
widget.patientER.patientERTransportationMethod =
_erTransportationMethod;
widget.patientER.orderServiceID =
_orderService.getIdOrderService();
widget.patientER.pickupUrgency = 1; widget.patientER.pickupUrgency = 1;
widget.patientER.lineItemNo = 1; widget.patientER.lineItemNo = 1;
widget.patientER.cost = _erTransportationMethod.price; widget.patientER.cost = _erTransportationMethod.price;
widget.patientER.vAT = _erTransportationMethod.vAT ?? 0; widget.patientER.vAT = _erTransportationMethod.vAT ?? 0;
widget.patientER.totalPrice = _erTransportationMethod.totalPrice; widget.patientER.totalPrice =
_erTransportationMethod.totalPrice;
widget.changeCurrentTab(1); widget.changeCurrentTab(1);
}); });
}, },
label: TranslationBase.of(context).next, label: TranslationBase.of(context).next,
), ),
)
],
),
), ),
); );
} }

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.da
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/core/enum/Ambulate.dart'; import 'package:diplomaticquarterapp/core/enum/Ambulate.dart';
@ -18,11 +19,13 @@ class Summary extends StatefulWidget {
_SummaryState createState() => _SummaryState(); _SummaryState createState() => _SummaryState();
} }
//TODO it should be dynamic
class _SummaryState extends State<Summary> { class _SummaryState extends State<Summary> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SingleChildScrollView( return AppScaffold(
isShowDecPage: false,
isShowAppBar: false,
body: SingleChildScrollView(
child: Container( child: Container(
margin: EdgeInsets.only(left: 12, right: 12), margin: EdgeInsets.only(left: 12, right: 12),
child: Column( child: Column(
@ -45,29 +48,29 @@ class _SummaryState extends State<Summary> {
SizedBox(height: 8,), SizedBox(height: 8,),
Texts(TranslationBase.of(context).directions,color: Colors.grey,), Texts(TranslationBase.of(context).directions,color: Colors.grey,),
Texts('From Hospital',bold: true,), Texts(widget.patientER.direction ==0? TranslationBase.of(context).toHospital:TranslationBase.of(context).fromHospital,bold: true,),
SizedBox(height: 8,), SizedBox(height: 8,),
Texts('Pickup Location',color: Colors.grey,), Texts(TranslationBase.of(context).pickupLocation,color: Colors.grey,),
Texts('SZR Medical Center',bold: true,), Texts('${widget.patientER.pickupLocationName}',bold: true,),
SizedBox(height: 8,), SizedBox(height: 8,),
Texts('Drop off location',color: Colors.grey,), Texts(TranslationBase.of(context).dropoffLocation,color: Colors.grey,),
Texts('6199, Al Ameen wlfn nif',bold: true,), Texts('${widget.patientER.dropoffLocationName}',bold: true,),
SizedBox(height: 8,), SizedBox(height: 8,),
Texts('Select Ambulate',color: Colors.grey,), Texts(TranslationBase.of(context).selectAmbulate,color: Colors.grey,),
Texts('${widget.patientER.ambulate.getAmbulateTitle(context)}',bold: true,), Texts('${widget.patientER.ambulate.getAmbulateTitle(context)}',bold: true,),
SizedBox(height: 8,), SizedBox(height: 8,),
Texts('Note',color: Colors.grey,), Texts(TranslationBase.of(context).notes,color: Colors.grey,),
Texts('${widget.patientER.requesterNote?? '---'}',bold: true,), Texts('${widget.patientER.requesterNote?? '---'}',bold: true,),
SizedBox(height: 8,), SizedBox(height: 8,),
], ],
), ),
), ),
SizedBox(height: 20,), SizedBox(height: 20,),
Texts('Bill Amount',textAlign: TextAlign.start,), Texts(TranslationBase.of(context).billAmount,textAlign: TextAlign.start,),
SizedBox(height: 5,), SizedBox(height: 5,),
Container( Container(
height: 55, height: 55,
@ -79,17 +82,22 @@ class _SummaryState extends State<Summary> {
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Texts('Total amount payable:'), Texts(TranslationBase.of(context).patientShareTotal+':'),
Texts('SR ${widget.patientER.patientERTransportationMethod.totalPrice}') Texts(TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.totalPrice}')
], ],
), ),
), ),
SizedBox(height: 45,), SizedBox(height: 45,),
Container(
],
),
),
),
bottomSheet: Container(
padding: EdgeInsets.all(15), padding: EdgeInsets.all(15),
width: double.maxFinite, width: double.maxFinite,
height: 76, height: 90,
child:SecondaryButton( child:SecondaryButton(
color: Colors.grey[800], color: Colors.grey[800],
textColor: Colors.white, textColor: Colors.white,
@ -99,9 +107,6 @@ class _SummaryState extends State<Summary> {
} }
), ),
)
],
),
), ),
); );
} }

@ -30,28 +30,28 @@ class OrderLogPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
OrderLogItem( OrderLogItem(
title: 'Request ID', title: TranslationBase.of(context).reqId,
value: amRequestViewModel.patientAllPresOrdersList[index].iD value: amRequestViewModel.patientAllPresOrdersList[index].iD
.toString(), .toString(),
), ),
OrderLogItem( OrderLogItem(
title: 'Status', title: TranslationBase.of(context).orderStatus,
value: amRequestViewModel value: amRequestViewModel
.patientAllPresOrdersList[index].description, .patientAllPresOrdersList[index].description,
), ),
OrderLogItem( OrderLogItem(
title: 'Pickup Date', title: TranslationBase.of(context).pickupDate,
value: DateUtil.getDayMonthYearDateFormatted( value: DateUtil.getDayMonthYearDateFormatted(
DateUtil.convertStringToDate(amRequestViewModel DateUtil.convertStringToDate(amRequestViewModel
.patientAllPresOrdersList[index].createdOn)), .patientAllPresOrdersList[index].createdOn)),
), ),
OrderLogItem( OrderLogItem(
title: 'Pickup Location', title: TranslationBase.of(context).pickupLocation,
value: amRequestViewModel value: amRequestViewModel
.patientAllPresOrdersList[index].pickupLocationName, .patientAllPresOrdersList[index].pickupLocationName,
), ),
OrderLogItem( OrderLogItem(
title: 'Drop off Location', title: TranslationBase.of(context).dropoffLocation,
value: amRequestViewModel value: amRequestViewModel
.patientAllPresOrdersList[index].dropoffLocationName, .patientAllPresOrdersList[index].dropoffLocationName,
), ),

@ -13,7 +13,8 @@ class StepsWidget extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return projectViewModel.isArabic? Stack( return projectViewModel.isArabic?
Stack(
children: [ children: [
Container( Container(
height: 50, height: 50,
@ -29,7 +30,7 @@ class StepsWidget extends StatelessWidget {
), ),
Positioned( Positioned(
top: 10, top: 10,
left: 0, right: 0,
child: InkWell( child: InkWell(
onTap: () => changeCurrentTab(0), onTap: () => changeCurrentTab(0),
child: Container( child: Container(
@ -51,7 +52,7 @@ class StepsWidget extends StatelessWidget {
), ),
Positioned( Positioned(
top: 10, top: 10,
left: MediaQuery.of(context).size.width * 0.3, right: MediaQuery.of(context).size.width * 0.3,
child: InkWell( child: InkWell(
onTap: () => index >= 2 ? changeCurrentTab(1) : null, onTap: () => index >= 2 ? changeCurrentTab(1) : null,
child: Container( child: Container(
@ -73,7 +74,7 @@ class StepsWidget extends StatelessWidget {
), ),
Positioned( Positioned(
top: 10, top: 10,
left: MediaQuery.of(context).size.width * 0.6, right: MediaQuery.of(context).size.width * 0.6,
child: InkWell( child: InkWell(
onTap: () => index >= 3 ? changeCurrentTab(2) : null, onTap: () => index >= 3 ? changeCurrentTab(2) : null,
child: Container( child: Container(
@ -95,7 +96,7 @@ class StepsWidget extends StatelessWidget {
), ),
Positioned( Positioned(
top: 10, top: 10,
right: 0, left: 0,
child: InkWell( child: InkWell(
onTap: () => index == 2 ?changeCurrentTab(3):null, onTap: () => index == 2 ?changeCurrentTab(3):null,
child: Container( child: Container(
@ -117,7 +118,8 @@ class StepsWidget extends StatelessWidget {
), ),
), ),
], ],
):Stack( ):
Stack(
children: [ children: [
Container( Container(
height: 50, height: 50,
@ -133,7 +135,7 @@ class StepsWidget extends StatelessWidget {
), ),
Positioned( Positioned(
top: 10, top: 10,
right: 0, left: 0,
child: InkWell( child: InkWell(
onTap: () => changeCurrentTab(0), onTap: () => changeCurrentTab(0),
child: Container( child: Container(
@ -155,7 +157,7 @@ class StepsWidget extends StatelessWidget {
), ),
Positioned( Positioned(
top: 10, top: 10,
right: MediaQuery.of(context).size.width * 0.3, left: MediaQuery.of(context).size.width * 0.3,
child: InkWell( child: InkWell(
onTap: () => index >= 2 ? changeCurrentTab(1) : null, onTap: () => index >= 2 ? changeCurrentTab(1) : null,
child: Container( child: Container(
@ -177,7 +179,7 @@ class StepsWidget extends StatelessWidget {
), ),
Positioned( Positioned(
top: 10, top: 10,
right: MediaQuery.of(context).size.width * 0.6, left: MediaQuery.of(context).size.width * 0.6,
child: InkWell( child: InkWell(
onTap: () => index >= 3 ? changeCurrentTab(2) : null, onTap: () => index >= 3 ? changeCurrentTab(2) : null,
child: Container( child: Container(
@ -199,7 +201,7 @@ class StepsWidget extends StatelessWidget {
), ),
Positioned( Positioned(
top: 10, top: 10,
left: 0, right: 0,
child: InkWell( child: InkWell(
onTap: () => index == 2 ?changeCurrentTab(3):null, onTap: () => index == 2 ?changeCurrentTab(3):null,
child: Container( child: Container(

@ -1250,6 +1250,7 @@ class TranslationBase {
String get infoCMC => localizedValues['infoCMC'][locale.languageCode]; String get infoCMC => localizedValues['infoCMC'][locale.languageCode];
String get instructionAgree => localizedValues['instructionAgree'][locale.languageCode]; String get instructionAgree => localizedValues['instructionAgree'][locale.languageCode];
String get reqId => localizedValues['reqId'][locale.languageCode]; String get reqId => localizedValues['reqId'][locale.languageCode];
String get ordersLog => localizedValues['RRT-orders-log'][locale.languageCode];
} }

Loading…
Cancel
Save