@ -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: _long itude,
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. showProgress Dialog( context ) ;
GifLoaderDialogUtils. showMy Dialog( 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. hideProgress Dialog( context ) ;
GifLoaderDialogUtils. hide Dialog( context ) ;
Navigator . push (
Navigator . push (
context ,
context ,
MaterialPageRoute (
MaterialPageRoute (
@ -491,14 +517,15 @@ class _PickupLocationState extends State<PickupLocation> {
}
}
} ) ;
} ) ;
} else {
} else {
ProgressDialogUtil. hideProgress Dialog( context ) ;
GifLoaderDialogUtils. hide Dialog( 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. hideProgress Dialog( context ) ;
GifLoaderDialogUtils. hide Dialog( context ) ;
AppToast . showErrorToast ( message: e ) ;
AppToast . showErrorToast ( message: e ) ;
} ) ;
} ) ;
}
}