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,306 +46,309 @@ class _BillAmountState extends State<BillAmount> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SingleChildScrollView( return AppScaffold(
physics: BouncingScrollPhysics(), isShowDecPage: false,
child: Container( isShowAppBar: false,
margin: EdgeInsets.only(left: 12, right: 12), body: SingleChildScrollView(
child: Column( physics: BouncingScrollPhysics(),
crossAxisAlignment: CrossAxisAlignment.start, child: Container(
children: [ margin: EdgeInsets.only(left: 12, right: 12),
Texts(TranslationBase.of(context).billAmount), child: Column(
SizedBox( crossAxisAlignment: CrossAxisAlignment.start,
height: 10, children: [
), Texts(TranslationBase.of(context).billAmount),
Table( SizedBox(
border: TableBorder.symmetric( height: 10,
inside: BorderSide(width: 1.0, color: Colors.grey[300]), ),
outside: BorderSide(width: 1.0, color: Colors.grey[300])), Table(
children: [ border: TableBorder.symmetric(
TableRow( inside: BorderSide(width: 1.0, color: Colors.grey[300]),
children: [ outside: BorderSide(width: 1.0, color: Colors.grey[300])),
Container( children: [
height: MediaQuery.of(context).size.height * 0.09, TableRow(
decoration: BoxDecoration( children: [
color: Colors.white, Container(
borderRadius: BorderRadius.only( height: MediaQuery.of(context).size.height * 0.09,
topLeft: Radius.circular(10.0), decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(10.0),
),
), ),
), child: Padding(
child: Padding( padding: const EdgeInsets.all(8.0),
padding: const EdgeInsets.all(8.0), child: Texts(
child: Texts( TranslationBase.of(context).patientShareB,
TranslationBase.of(context).patientShareB, textAlign: TextAlign.start,
textAlign: TextAlign.start, color: Colors.black,
color: Colors.black, fontSize: 15,
fontSize: 15, ),
), ),
), ),
), Container(
Container( height: MediaQuery.of(context).size.height * 0.09,
height: MediaQuery.of(context).size.height * 0.09, decoration: BoxDecoration(
decoration: BoxDecoration( color: Colors.white,
color: Colors.white, borderRadius: BorderRadius.only(
borderRadius: BorderRadius.only( topRight: Radius.circular(10.0),
topRight: Radius.circular(10.0), ),
), ),
), child: Padding(
child: Padding( padding: const EdgeInsets.all(8.0),
padding: const EdgeInsets.all(8.0), child: Texts(
child: Texts( TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.price}',
TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.price}', color: Colors.black,
color: Colors.black, textAlign: TextAlign.start,
textAlign: TextAlign.start, fontSize: 15,
fontSize: 15, ),
), ),
), ),
), ],
], ),
), TableRow(
TableRow( children: [
children: [ Container(
Container( color: Colors.white,
color: Colors.white, height: MediaQuery.of(context).size.height * 0.09,
height: MediaQuery.of(context).size.height * 0.09, child: Padding(
child: Padding( padding: const EdgeInsets.all(8.0),
padding: const EdgeInsets.all(8.0), child: Texts(
child: Texts( TranslationBase.of(context).patientShareTax,
TranslationBase.of(context).patientShareTax, color: Colors.black,
color: Colors.black, fontSize: 15,
fontSize: 15, textAlign: TextAlign.start,
textAlign: TextAlign.start, ),
),
),
),
Container(
height: MediaQuery.of(context).size.height * 0.09,
color: Colors.white,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(
TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.vAT}',
color: Colors.black,
fontSize: 15,
textAlign: TextAlign.start,
), ),
), ),
), Container(
], height: MediaQuery.of(context).size.height * 0.09,
),
TableRow(
children: [
Container(
height: MediaQuery.of(context).size.height * 0.09,
decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.only( child: Padding(
bottomLeft: Radius.circular(10.0), padding: const EdgeInsets.all(8.0),
child: Texts(
TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.vAT}',
color: Colors.black,
fontSize: 15,
textAlign: TextAlign.start,
),
), ),
), ),
child: Padding( ],
padding: const EdgeInsets.all(8.0), ),
child: Texts( TableRow(
TranslationBase.of(context).patientShareTotal, children: [
color: Colors.black, Container(
fontSize: 15, height: MediaQuery.of(context).size.height * 0.09,
textAlign: TextAlign.start, decoration: BoxDecoration(
bold: true, color: Colors.white,
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(10.0),
),
), ),
), child: Padding(
), padding: const EdgeInsets.all(8.0),
Container( child: Texts(
height: MediaQuery.of(context).size.height * 0.09, TranslationBase.of(context).patientShareTotal,
decoration: BoxDecoration( color: Colors.black,
color: Colors.white, fontSize: 15,
borderRadius: BorderRadius.only( textAlign: TextAlign.start,
bottomRight: Radius.circular(10.0), bold: true,
),
), ),
), ),
child: Padding( Container(
padding: const EdgeInsets.all(8.0), height: MediaQuery.of(context).size.height * 0.09,
child: Texts( decoration: BoxDecoration(
TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.totalPrice}', color: Colors.white,
color: Colors.black, borderRadius: BorderRadius.only(
fontSize: 15, bottomRight: Radius.circular(10.0),
textAlign: TextAlign.start, ),
),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(
TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.totalPrice}',
color: Colors.black,
fontSize: 15,
textAlign: TextAlign.start,
),
), ),
), ),
), ],
], ),
), ],
], ),
), SizedBox(
SizedBox( height: 10,
height: 10, ),
), Texts(TranslationBase.of(context).selectAmbulate,bold: true,),
Texts(TranslationBase.of(context).selectAmbulate,bold: true,), SizedBox(height: 5,),
SizedBox(height: 5,), Row(
Row( children: [
children: [ Expanded(
Expanded( child: InkWell(
child: InkWell( onTap: () {
onTap: () { setState(() {
setState(() { _ambulate = Ambulate.Wheelchair;
_ambulate = Ambulate.Wheelchair; });
}); },
}, child: Container(
child: Container( decoration: BoxDecoration(
decoration: BoxDecoration( shape: BoxShape.rectangle,
shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8),
borderRadius: BorderRadius.circular(8), border:
border: Border.all(color: Colors.grey, width: 0.5),
Border.all(color: Colors.grey, width: 0.5), color: Colors.white,
color: Colors.white, ),
), child: ListTile(
child: ListTile( title: Text(TranslationBase.of(context).wheelchair),
title: Text(TranslationBase.of(context).wheelchair), leading: Radio(
leading: Radio( value: Ambulate.Wheelchair,
value: Ambulate.Wheelchair, groupValue: _ambulate,
groupValue: _ambulate, onChanged: (value) {
activeColor: Colors.red[800], setState(() {
onChanged: (value) { _ambulate = value;
setState(() { });
_ambulate = value; },
}); ),
},
), ),
), ),
), ),
), ),
), Expanded(
Expanded( child: InkWell(
child: InkWell( onTap: () {
onTap: () { setState(() {
setState(() { _ambulate = Ambulate.Walker;
_ambulate = Ambulate.Walker; });
}); },
}, child: Container(
child: Container( decoration: BoxDecoration(
decoration: BoxDecoration( shape: BoxShape.rectangle,
shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8),
borderRadius: BorderRadius.circular(8), border:
border: Border.all(color: Colors.grey, width: 0.5),
Border.all(color: Colors.grey, width: 0.5), color: Colors.white,
color: Colors.white, ),
), child: ListTile(
child: ListTile( title: Text(TranslationBase.of(context).walker),
title: Text(TranslationBase.of(context).walker), 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; });
}); },
}, ),
), ),
), ),
), ),
), ),
), ],
], ),
), SizedBox(height: 5,),
SizedBox(height: 5,), Row(
Row( children: [
children: [ Expanded(
Expanded( child: InkWell(
child: InkWell( onTap: () {
onTap: () { setState(() {
setState(() { _ambulate = Ambulate.Stretcher;
_ambulate = Ambulate.Stretcher; });
}); },
}, child: Container(
child: Container( decoration: BoxDecoration(
decoration: BoxDecoration( shape: BoxShape.rectangle,
shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8),
borderRadius: BorderRadius.circular(8), border:
border: Border.all(color: Colors.grey, width: 0.5),
Border.all(color: Colors.grey, width: 0.5), color: Colors.white,
color: Colors.white, ),
), child: ListTile(
child: ListTile( title: Text(TranslationBase.of(context).stretcher),
title: Text(TranslationBase.of(context).stretcher), 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; });
}); },
}, ),
), ),
), ),
), ),
), ),
), Expanded(
Expanded( child: InkWell(
child: InkWell( onTap: () {
onTap: () { setState(() {
setState(() { _ambulate = Ambulate.None;
_ambulate = Ambulate.None; });
}); },
}, child: Container(
child: Container( decoration: BoxDecoration(
decoration: BoxDecoration( shape: BoxShape.rectangle,
shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8),
borderRadius: BorderRadius.circular(8), border:
border: Border.all(color: Colors.grey, width: 0.5),
Border.all(color: Colors.grey, width: 0.5), color: Colors.white,
color: Colors.white, ),
), child: ListTile(
child: ListTile( title: Text(TranslationBase.of(context).none),
title: Text(TranslationBase.of(context).none), 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; });
}); },
}, ),
), ),
), ),
), ),
), ),
), ],
], ),
), SizedBox(height: 12,),
SizedBox(height: 12,), NewTextFields(
NewTextFields( hintText: TranslationBase.of(context).notes,
hintText: TranslationBase.of(context).notes, initialValue: note,
initialValue: note, onChanged: (value){
onChanged: (value){
setState(() {
note = value;
});
},
),
SizedBox(
height: 15,
),
Container(
padding: EdgeInsets.all(15),
width: double.maxFinite,
height: 76,
child: SecondaryButton(
color: Colors.grey[800],
textColor: Colors.white,
onTap: () {
setState(() { setState(() {
widget.patientER.ambulate = _ambulate; note = value;
widget.patientER.requesterNote = note;
widget.patientER.selectedAmbulate = _ambulate.selectAmbulateNumber();
widget.changeCurrentTab(3);
}); });
}, },
label: TranslationBase.of(context).next,
), ),
)
], SizedBox(
height: 15,
),
],
),
),
),
bottomSheet: Container(
padding: EdgeInsets.all(15),
width: double.maxFinite,
height: 90,
child: SecondaryButton(
color: Colors.grey[800],
textColor: Colors.white,
onTap: () {
setState(() {
widget.patientER.ambulate = _ambulate;
widget.patientER.requesterNote = note;
widget.patientER.selectedAmbulate = _ambulate.selectAmbulateNumber();
widget.changeCurrentTab(3);
});
},
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,370 +65,397 @@ class _PickupLocationState extends State<PickupLocation> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SingleChildScrollView( return AppScaffold(
physics: BouncingScrollPhysics(), isShowAppBar: false,
child: Container( isShowDecPage: false,
margin: EdgeInsets.only(left: 12, right: 12), body: SingleChildScrollView(
child: Column( physics: BouncingScrollPhysics(),
crossAxisAlignment: CrossAxisAlignment.start, child: Container(
children: [ margin: EdgeInsets.only(left: 12, right: 12),
if (widget.patientER.direction == 1) child: Column(
Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ if (widget.patientER.direction == 1)
Texts(TranslationBase.of(context).pickupLocation), Column(
SizedBox( crossAxisAlignment: CrossAxisAlignment.start,
height: 15, children: [
), Texts(TranslationBase.of(context).pickupLocation),
InkWell( SizedBox(
onTap: (){ height: 15,
Navigator.push( ),
context, InkWell(
MaterialPageRoute( onTap: () {
builder: (context) => PickupLocationFromMap( Navigator.push(
latitude: _latitude, context,
longitude: _longitude, MaterialPageRoute(
onPick: (value) { builder: (context) => PickupLocationFromMap(
latitude: _latitude,
longitude: _longitude,
onPick: (value) {
setState(() {
_result = value;
});
},
),
),
);
},
child: Container(
padding: EdgeInsets.all(12),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(child: Texts(getSelectFromMapName(context))),
Icon(
FontAwesomeIcons.mapMarkerAlt,
size: 24,
color: Colors.black,
)
],
),
),
),
SizedBox(
height: 12,
),
Texts(TranslationBase.of(context).pickupSpot),
SizedBox(
height: 5,
),
InkWell(
onTap: () {
setState(() {
_isInsideHome = !_isInsideHome;
});
},
child: Container(
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: ListTile(
title: Texts(TranslationBase.of(context).insideHome),
leading: Checkbox(
value: _isInsideHome,
onChanged: (value) {
setState(() { setState(() {
_result = value; _isInsideHome = value;
}); });
}, },
), ),
), ),
);
},
child: Container(
padding: EdgeInsets.all(12),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(getSelectFromMapName(context)),
Icon(
FontAwesomeIcons.mapMarkerAlt,
size: 24,
color: Colors.black,
)
],
), ),
), ),
), SizedBox(
SizedBox( height: 12,
height: 12, ),
), Texts(TranslationBase.of(context).haveAppo),
Texts(TranslationBase.of(context).pickupSpot), SizedBox(
SizedBox( height: 5,
height: 5,
),
InkWell(
onTap: () {
setState(() {
_isInsideHome = !_isInsideHome;
});
},
child: Container(
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: ListTile(
title: Texts(TranslationBase.of(context).insideHome),
leading: Checkbox(
activeColor: Colors.red[800],
value: _isInsideHome,
onChanged: (value) {
setState(() {
_isInsideHome = value;
});
},
),
),
), ),
), Row(
SizedBox( children: [
height: 12, Expanded(
), child: InkWell(
Texts(TranslationBase.of(context).haveAppo), onTap: () {
SizedBox( if (myAppointment == null) {
height: 5, getAppointment();
), setState(() {
Row( _haveAppointment = HaveAppointment.YES;
children: [ });
Expanded( }
child: InkWell( },
onTap: () { child: Container(
if (myAppointment == null) { decoration: BoxDecoration(
getAppointment(); shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border:
Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: ListTile(
title: Texts(TranslationBase.of(context).yes),
leading: Radio(
value: HaveAppointment.YES,
groupValue: _haveAppointment,
onChanged: (value) {
if (myAppointment == null) {
getAppointment();
setState(() {
_haveAppointment = value;
});
}
},
),
),
),
),
),
Expanded(
child: InkWell(
onTap: () {
setState(() { setState(() {
_haveAppointment = HaveAppointment.YES; _haveAppointment = HaveAppointment.NO;
myAppointment = null;
}); });
} },
}, child: Container(
child: Container( decoration: BoxDecoration(
decoration: BoxDecoration( shape: BoxShape.rectangle,
shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8),
borderRadius: BorderRadius.circular(8), border:
border: Border.all(color: Colors.grey, width: 0.5),
Border.all(color: Colors.grey, width: 0.5), color: Colors.white,
color: Colors.white, ),
), child: ListTile(
child: ListTile( title: Texts(TranslationBase.of(context).no),
title: Texts(TranslationBase.of(context).yes), leading: Radio(
leading: Radio( value: HaveAppointment.NO,
value: HaveAppointment.YES, groupValue: _haveAppointment,
groupValue: _haveAppointment, onChanged: (value) {
activeColor: Colors.red[800],
onChanged: (value) {
if (myAppointment == null) {
getAppointment();
setState(() { setState(() {
_haveAppointment = value; _haveAppointment = value;
myAppointment = null;
}); });
} },
}, ),
), ),
), ),
), ),
), ),
),
Expanded(
child: InkWell(
onTap: () {
setState(() {
_haveAppointment = HaveAppointment.NO;
myAppointment = null;
});
},
child: Container(
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border:
Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: ListTile(
title: Texts(TranslationBase.of(context).no),
leading: Radio(
value: HaveAppointment.NO,
groupValue: _haveAppointment,
activeColor: Colors.red[800],
onChanged: (value) {
setState(() {
_haveAppointment = value;
myAppointment = null;
});
},
),
),
),
),
),
],
),
if (myAppointment != null)
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 12,
),
AppointmentCard(
appointment: myAppointment,
)
], ],
), ),
SizedBox( if (myAppointment != null)
height: 12, Column(
), crossAxisAlignment: CrossAxisAlignment.start,
Texts(TranslationBase.of(context).dropoffLocation),
SizedBox(
height: 8,
),
InkWell(
onTap: () {
confirmSelectHospitalDialog(
widget.amRequestViewModel.hospitals);
},
child: Container(
padding: EdgeInsets.all(12),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Texts(getHospitalName(TranslationBase.of(context).pickupLocation)), SizedBox(
Icon( height: 12,
Icons.arrow_drop_down, ),
size: 24, AppointmentCard(
color: Colors.black, appointment: myAppointment,
) )
], ],
), ),
SizedBox(
height: 12,
), ),
), Texts(TranslationBase.of(context).dropoffLocation),
], SizedBox(
), height: 8,
if (widget.patientER.direction == 0) ),
Column( InkWell(
crossAxisAlignment: CrossAxisAlignment.start, onTap: () {
children: [ confirmSelectHospitalDialog(
Texts(TranslationBase.of(context).pickupLocation), widget.amRequestViewModel.hospitals);
SizedBox( },
height: 15, child: Container(
), padding: EdgeInsets.all(12),
InkWell( decoration: BoxDecoration(
onTap: () { shape: BoxShape.rectangle,
confirmSelectHospitalDialog( borderRadius: BorderRadius.circular(8),
widget.amRequestViewModel.hospitals); border: Border.all(color: Colors.grey, width: 0.5),
}, color: Colors.white,
child: Container( ),
padding: EdgeInsets.all(12), child: Row(
decoration: BoxDecoration( mainAxisAlignment: MainAxisAlignment.spaceBetween,
shape: BoxShape.rectangle, children: [
borderRadius: BorderRadius.circular(8), Texts(getHospitalName(
border: Border.all(color: Colors.grey, width: 0.5), TranslationBase.of(context).pickupLocation)),
color: Colors.white, Icon(
Icons.arrow_drop_down,
size: 24,
color: Colors.black,
)
],
),
), ),
child: Row( ),
mainAxisAlignment: MainAxisAlignment.spaceBetween, ],
children: [ ),
Texts(getHospitalName(TranslationBase.of(context).pickupLocation)), if (widget.patientER.direction == 0)
Icon( Column(
Icons.arrow_drop_down, crossAxisAlignment: CrossAxisAlignment.start,
size: 24, children: [
color: Colors.black, Texts(TranslationBase.of(context).pickupLocation),
) SizedBox(
], height: 15,
),
InkWell(
onTap: () {
confirmSelectHospitalDialog(
widget.amRequestViewModel.hospitals);
},
child: Container(
padding: EdgeInsets.all(12),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(getHospitalName(
TranslationBase.of(context).pickupLocation)),
Icon(
Icons.arrow_drop_down,
size: 24,
color: Colors.black,
)
],
),
), ),
), ),
), SizedBox(
SizedBox( height: 12,
height: 12, ),
), Texts(TranslationBase.of(context).dropoffLocation),
Texts(TranslationBase.of(context).dropoffLocation), SizedBox(
SizedBox( height: 8,
height: 8, ),
), InkWell(
InkWell( onTap: () {
onTap: () { Navigator.push(
Navigator.push( context,
context, MaterialPageRoute(
MaterialPageRoute( builder: (context) => PickupLocationFromMap(
builder: (context) => PickupLocationFromMap( latitude: _latitude,
latitude: _latitude, longitude: _longitude,
longitude: _longitude, onPick: (value) {
onPick: (value) { setState(() {
setState(() { _result = value;
_result = value; });
}); },
}, ),
), ),
);
},
child: Container(
padding: EdgeInsets.all(12),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(child: Texts(getSelectFromMapName(context))),
Icon(
FontAwesomeIcons.mapMarkerAlt,
size: 24,
color: Colors.black,
)
],
), ),
);
},
child: Container(
padding: EdgeInsets.all(12),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(getSelectFromMapName(context)),
Icon(
FontAwesomeIcons.mapMarkerAlt,
size: 24,
color: Colors.black,
)
],
), ),
), ),
), ],
], ),
SizedBox(
height: 45,
), ),
SizedBox( ],
height: 45, ),
), ),
Container( ),
padding: EdgeInsets.all(15), bottomSheet: Container(
width: double.maxFinite, padding: EdgeInsets.all(15),
height: 76, width: double.maxFinite,
child: SecondaryButton( height: 90,
color: Colors.grey[800], child: SecondaryButton(
textColor: Colors.white, color: Colors.grey[800],
onTap: () { textColor: Colors.white,
if (_result == null || _selectedHospital == null) onTap: () {
AppToast.showErrorToast( if (_result == null || _selectedHospital == null)
message: TranslationBase.of(context).selectAll); AppToast.showErrorToast(
else message: TranslationBase.of(context).selectAll);
setState(() { else
widget.patientER.pickupSpot = _isInsideHome ? 1 : 0; setState(() {
if (widget.patientER.direction == 0) { widget.patientER.pickupSpot = _isInsideHome ? 1 : 0;
widget.patientER.pickupLocationLattitude = _result.geometry.location.lat.toString(); if (widget.patientER.direction == 0) {
widget.patientER.pickupLocationLongitude = _result.geometry.location.lng.toString(); widget.patientER.pickupLocationLattitude =
widget.patientER.dropoffLocationLattitude = _selectedHospital.latitude; _result.geometry.location.lat.toString();
widget.patientER.dropoffLocationLongitude = _selectedHospital.longitude; widget.patientER.pickupLocationLongitude =
} else { _result.geometry.location.lng.toString();
widget.patientER.pickupLocationLattitude = _selectedHospital.latitude; widget.patientER.dropoffLocationLattitude =
widget.patientER.pickupLocationLongitude = _selectedHospital.longitude; _selectedHospital.latitude;
widget.patientER.dropoffLocationLattitude = _result.geometry.location.lat.toString(); widget.patientER.dropoffLocationLongitude =
widget.patientER.dropoffLocationLongitude = _result.geometry.location.lng.toString(); _selectedHospital.longitude;
} } else {
widget.patientER.pickupLocationLattitude =
_selectedHospital.latitude;
widget.patientER.pickupLocationLongitude =
_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.requesterIsOutSA = false; widget.patientER.patientIdentificationID = widget
widget.patientER.lineItemNo =0; .amRequestViewModel.user.patientIdentificationNo;
widget.patientER.requesterMobileNo = widget.amRequestViewModel.user.mobileNumber; 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.lineItemNo = 0;
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 =
widget.patientER.haveAppointment = true; myAppointment.doctorNameObj;
} else { widget.patientER.appointmentBranch =
widget.patientER.appointmentNo = "0"; myAppointment.projectName;
widget.patientER.appointmentClinicName = null; widget.patientER.appointmentTime =
widget.patientER.appointmentDoctorName = null; myAppointment.appointmentDate;
widget.patientER.appointmentBranch = null; widget.patientER.haveAppointment = true;
widget.patientER.appointmentTime = null; } else {
widget.patientER.haveAppointment = false; widget.patientER.appointmentNo = "0";
} widget.patientER.appointmentClinicName = null;
widget.patientER.appointmentDoctorName = null;
widget.patientER.appointmentBranch = null;
widget.patientER.appointmentTime = null;
widget.patientER.haveAppointment = false;
}
widget.patientER.pickupSpot = _isInsideHome ? 1 : 0; widget.patientER.pickupSpot = _isInsideHome ? 1 : 0;
widget.changeCurrentTab(2); widget.changeCurrentTab(2);
}); });
}, },
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,251 +58,267 @@ class _SelectTransportationMethodState
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SingleChildScrollView( ProjectViewModel projectViewModel = Provider.of(context);
physics: BouncingScrollPhysics(), return AppScaffold(
child: Container( isShowAppBar: false,
margin: EdgeInsets.only(left: 12, right: 12), isShowDecPage: false,
child: Column( body: SingleChildScrollView(
crossAxisAlignment: CrossAxisAlignment.start, physics: BouncingScrollPhysics(),
children: [ child: Container(
SizedBox( margin: EdgeInsets.only(left: 12, right: 12),
height: 12, child: Column(
), crossAxisAlignment: CrossAxisAlignment.start,
Texts(TranslationBase.of(context).transportHeading), children: [
...List.generate( SizedBox(
widget.amRequestViewModel.amRequestModeList.length, height: 12,
(index) => InkWell( ),
onTap: () { Texts(TranslationBase.of(context).transportHeading),
setState(() { ...List.generate(
_erTransportationMethod = widget.amRequestViewModel.amRequestModeList.length,
widget.amRequestViewModel.amRequestModeList[index]; (index) => InkWell(
}); onTap: () {
}, setState(() {
child: Container( _erTransportationMethod =
margin: EdgeInsets.all(5), widget.amRequestViewModel.amRequestModeList[index];
decoration: BoxDecoration( });
shape: BoxShape.rectangle, },
borderRadius: BorderRadius.circular(8), child: Container(
border: Border.all(color: Colors.grey, width: 0.5), margin: EdgeInsets.all(5),
color: Colors.white, decoration: BoxDecoration(
), shape: BoxShape.rectangle,
child: Row( borderRadius: BorderRadius.circular(8),
children: [ border: Border.all(color: Colors.grey, width: 0.5),
Expanded( color: Colors.white,
flex: 3, ),
child: ListTile( child: Row(
title: Text(widget.amRequestViewModel children: [
.amRequestModeList[index].title), Expanded(
leading: Radio( flex: 3,
value: widget child: ListTile(
.amRequestViewModel.amRequestModeList[index], title: Texts(projectViewModel.isArabic
groupValue: _erTransportationMethod, ? widget.amRequestViewModel
activeColor: Colors.red[800], .amRequestModeList[index].titleAR
onChanged: (value) { : widget.amRequestViewModel
setState(() { .amRequestModeList[index].title),
_erTransportationMethod = value; leading: Radio(
}); value: widget
}, .amRequestViewModel.amRequestModeList[index],
groupValue: _erTransportationMethod,
onChanged: (value) {
setState(() {
_erTransportationMethod = value;
});
},
),
), ),
), ),
), Expanded(
Expanded( flex: 1,
flex: 1, child: Texts(TranslationBase.of(context).sar +
child: Texts( ' ${widget.amRequestViewModel.amRequestModeList[index].price}'),
TranslationBase.of(context).sar+' ${widget.amRequestViewModel.amRequestModeList[index].price}'), )
) ],
], ),
), ),
), ),
), ),
), SizedBox(
SizedBox( height: 12,
height: 12, ),
), Texts(TranslationBase.of(context).directionHeading),
Texts(TranslationBase.of(context).directionHeading), SizedBox(
SizedBox( height: 5,
height: 5, ),
), Container(
Container( width: double.maxFinite,
width: double.maxFinite, child: Row(
child: Row( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start, children: [
children: [ Expanded(
Expanded( child: InkWell(
child: InkWell( onTap: () {
onTap: () { setState(() {
setState(() { _direction = Direction.ToHospital;
_direction = Direction.ToHospital; });
}); },
}, child: Container(
child: Container( width: double.maxFinite,
width: double.maxFinite, decoration: BoxDecoration(
decoration: BoxDecoration( shape: BoxShape.rectangle,
shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8),
borderRadius: BorderRadius.circular(8), border: Border.all(color: Colors.grey, width: 0.5),
border: Border.all(color: Colors.grey, width: 0.5), color: Colors.white,
color: Colors.white, ),
), child: ListTile(
child: ListTile( title: Texts(TranslationBase.of(context).toHospital),
title: Text(TranslationBase.of(context).toHospital), leading: Radio(
leading: Radio( value: Direction.ToHospital,
value: Direction.ToHospital, groupValue: _direction,
groupValue: _direction, onChanged: (value) {
activeColor: Colors.red[800], setState(() {
onChanged: (value) { _direction = value;
setState(() { });
_direction = value; },
}); ),
},
), ),
), ),
), ),
), ),
), Expanded(
Expanded( child: InkWell(
child: InkWell( onTap: () {
onTap: () { setState(() {
setState(() { _direction = Direction.FromHospital;
_direction = Direction.FromHospital; });
}); },
}, child: Container(
child: Container( width: double.maxFinite,
width: double.maxFinite, decoration: BoxDecoration(
decoration: BoxDecoration( shape: BoxShape.rectangle,
shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8),
borderRadius: BorderRadius.circular(8), border: Border.all(color: Colors.grey, width: 0.5),
border: Border.all(color: Colors.grey, width: 0.5), color: Colors.white,
color: Colors.white, ),
), child: ListTile(
child: ListTile( title:
title: Text(TranslationBase.of(context).fromHospital), 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; });
}); },
}, ),
), ),
), ),
), ),
), ),
), ],
], ),
), ),
), if (_direction == Direction.ToHospital)
if (_direction == Direction.ToHospital) Column(
Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ SizedBox(
SizedBox( height: 8,
height: 8, ),
), Texts(TranslationBase.of(context).directionHeading),
Texts(TranslationBase.of(context).directionHeading), SizedBox(
SizedBox( height: 5,
height: 5, ),
), Row(
Row( children: [
children: [ Expanded(
Expanded( child: InkWell(
child: InkWell( onTap: () {
onTap: () { setState(() {
setState(() { _way = Way.OneWay;
_way = Way.OneWay; });
}); },
}, child: Container(
child: Container( decoration: BoxDecoration(
decoration: BoxDecoration( shape: BoxShape.rectangle,
shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8),
borderRadius: BorderRadius.circular(8), border:
border: Border.all(color: Colors.grey, width: 0.5),
Border.all(color: Colors.grey, width: 0.5), color: Colors.white,
color: Colors.white, ),
), child: ListTile(
child: ListTile( title:
title: Text(TranslationBase.of(context).oneDirec), 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; });
}); },
}, ),
), ),
), ),
), ),
), ),
), Expanded(
Expanded( child: InkWell(
child: InkWell( onTap: () {
onTap: () { setState(() {
setState(() { _way = Way.TwoWays;
_way = Way.TwoWays; });
}); },
}, child: Container(
child: Container( decoration: BoxDecoration(
decoration: BoxDecoration( shape: BoxShape.rectangle,
shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8),
borderRadius: BorderRadius.circular(8), border:
border: Border.all(color: Colors.grey, width: 0.5),
Border.all(color: Colors.grey, width: 0.5), color: Colors.white,
color: Colors.white, ),
), child: ListTile(
child: ListTile( title:
title: Text(TranslationBase.of(context).twoDirec), 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; });
}); },
}, ),
), ),
), ),
), ),
), ),
), ],
], ),
), ],
], ),
), SizedBox(
SizedBox( height: 15,
height: 15,
),
Container(
padding: EdgeInsets.all(15),
width: double.maxFinite,
height: 76,
child: SecondaryButton(
color: Colors.grey[800],
textColor: Colors.white,
onTap: () {
setState(() {
widget.patientER.transportationMethodId =(widget.amRequestViewModel.amRequestModeList.indexOf(_erTransportationMethod) + 1);
widget.patientER.direction = _direction == Direction.ToHospital ? 1 : 0;
widget.patientER.tripType = _way == Way.TwoWays ? 0 : 1;
widget.patientER.selectedAmbulate = (widget.amRequestViewModel.amRequestModeList.indexOf(_erTransportationMethod) + 1);
widget.patientER.patientERTransportationMethod = _erTransportationMethod;
widget.patientER.orderServiceID = _orderService.getIdOrderService();
widget.patientER.pickupUrgency = 1;
widget.patientER.lineItemNo = 1;
widget.patientER.cost = _erTransportationMethod.price;
widget.patientER.vAT = _erTransportationMethod.vAT ?? 0;
widget.patientER.totalPrice = _erTransportationMethod.totalPrice;
widget.changeCurrentTab(1);
});
},
label: TranslationBase.of(context).next,
), ),
) ],
], ),
),
),
bottomSheet: Container(
padding: EdgeInsets.all(15),
width: double.maxFinite,
height: 90,
child: SecondaryButton(
color: Colors.grey[800],
textColor: Colors.white,
onTap: () {
setState(() {
widget.patientER.transportationMethodId = (widget
.amRequestViewModel.amRequestModeList
.indexOf(_erTransportationMethod) +
1);
widget.patientER.direction =
_direction == Direction.ToHospital ? 1 : 0;
widget.patientER.tripType = _way == Way.TwoWays ? 0 : 1;
widget.patientER.selectedAmbulate = (widget
.amRequestViewModel.amRequestModeList
.indexOf(_erTransportationMethod) +
1);
widget.patientER.patientERTransportationMethod =
_erTransportationMethod;
widget.patientER.orderServiceID =
_orderService.getIdOrderService();
widget.patientER.pickupUrgency = 1;
widget.patientER.lineItemNo = 1;
widget.patientER.cost = _erTransportationMethod.price;
widget.patientER.vAT = _erTransportationMethod.vAT ?? 0;
widget.patientER.totalPrice =
_erTransportationMethod.totalPrice;
widget.changeCurrentTab(1);
});
},
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,89 +19,93 @@ 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(
child: Container( isShowDecPage: false,
margin: EdgeInsets.only(left: 12, right: 12), isShowAppBar: false,
child: Column( body: SingleChildScrollView(
crossAxisAlignment: CrossAxisAlignment.start, child: Container(
children: [ margin: EdgeInsets.only(left: 12, right: 12),
Texts(TranslationBase.of(context).RRTSummary), child: Column(
SizedBox(height: 5,), crossAxisAlignment: CrossAxisAlignment.start,
Container( children: [
width: double.infinity, Texts(TranslationBase.of(context).RRTSummary),
padding: EdgeInsets.all(10), SizedBox(height: 5,),
decoration: BoxDecoration( Container(
color: Colors.white, width: double.infinity,
borderRadius: BorderRadius.circular(12), padding: EdgeInsets.all(10),
), decoration: BoxDecoration(
child: Column( color: Colors.white,
crossAxisAlignment: CrossAxisAlignment.start, borderRadius: BorderRadius.circular(12),
children: [ ),
Texts(TranslationBase.of(context).transportMethod,color: Colors.grey,), child: Column(
Texts('${widget.patientER.patientERTransportationMethod.title}',bold: true,), crossAxisAlignment: CrossAxisAlignment.start,
SizedBox(height: 8,), children: [
Texts(TranslationBase.of(context).transportMethod,color: Colors.grey,),
Texts('${widget.patientER.patientERTransportationMethod.title}',bold: true,),
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,),
Texts('Bill Amount',textAlign: TextAlign.start,),
SizedBox(height: 5,),
Container(
height: 55,
padding: EdgeInsets.all(10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8)
), ),
child: Row( SizedBox(height: 20,),
mainAxisAlignment: MainAxisAlignment.spaceBetween, Texts(TranslationBase.of(context).billAmount,textAlign: TextAlign.start,),
children: [ SizedBox(height: 5,),
Texts('Total amount payable:'), Container(
Texts('SR ${widget.patientER.patientERTransportationMethod.totalPrice}') height: 55,
], padding: EdgeInsets.all(10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8)
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(TranslationBase.of(context).patientShareTotal+':'),
Texts(TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.totalPrice}')
],
),
), ),
),
SizedBox(height: 45,), SizedBox(height: 45,),
Container(
padding: EdgeInsets.all(15),
width: double.maxFinite,
height: 76,
child:SecondaryButton(
color: Colors.grey[800],
textColor: Colors.white,
label: TranslationBase.of(context).send,
onTap: () async {
await widget.amRequestViewModel.insertERPressOrder(patientER: widget.patientER);
} ],
), ),
) ),
], ),
bottomSheet: Container(
padding: EdgeInsets.all(15),
width: double.maxFinite,
height: 90,
child:SecondaryButton(
color: Colors.grey[800],
textColor: Colors.white,
label: TranslationBase.of(context).send,
onTap: () async {
await widget.amRequestViewModel.insertERPressOrder(patientER: widget.patientER);
}
), ),
), ),
); );

@ -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