@ -6,12 +6,14 @@ import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.da
import ' package:diplomaticquarterapp/core/viewModels/project_view_model.dart ' ;
import ' package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart ' ;
import ' package:diplomaticquarterapp/models/ambulanceRequest/locationDetails.dart ' ;
import ' package:diplomaticquarterapp/theme/colors.dart ' ;
import ' package:diplomaticquarterapp/uitl/ProgressDialog.dart ' ;
import ' package:diplomaticquarterapp/uitl/app_toast.dart ' ;
import ' package:diplomaticquarterapp/uitl/date_uitl.dart ' ;
import ' package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart ' ;
import ' package:diplomaticquarterapp/uitl/location_util.dart ' ;
import ' package:diplomaticquarterapp/uitl/translations_delegate_base.dart ' ;
import ' package:diplomaticquarterapp/uitl/utils_new.dart ' ;
import ' package:diplomaticquarterapp/widgets/buttons/defaultButton.dart ' ;
import ' package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart ' ;
import ' package:diplomaticquarterapp/widgets/dialogs/radio_selection_dialog.dart ' ;
@ -496,13 +498,39 @@ class _PickupLocationState extends State<PickupLocation> {
) ,
] ,
) ,
/ / SizedBox (
/ / height: 45 ,
/ / ) ,
/ / if ( myAppointment ! = null )
/ / SizedBox (
/ / height: 100 ,
/ / ) ,
Container (
margin: EdgeInsets . only ( top: 12 ) ,
decoration: cardRadius ( 12 ) ,
padding: EdgeInsets . all ( 16.0 ) ,
child: Column (
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
Text ( TranslationBase . of ( context ) . billAmount + " : " , style: TextStyle ( fontSize: 16.0 , letterSpacing: - 0.64 , fontWeight: FontWeight . w600 ) ) ,
SizedBox ( height: 16.0 ) ,
Row (
mainAxisSize: MainAxisSize . max ,
mainAxisAlignment: MainAxisAlignment . spaceBetween ,
children: [
Text ( TranslationBase . of ( context ) . patientShareTotalToDo , style: TextStyle ( fontSize: 13.0 , letterSpacing: - 0.64 , fontWeight: FontWeight . w600 ) ) ,
Text (
TranslationBase . of ( context ) . sar + ( widget . patientER_RC . transportationDetails ! . tripType = = 1 ? ' ${ widget . patientER_RC . patientERTransportationMethod ! . priceTotal } ' : ' ${ ( widget . patientER_RC . patientERTransportationMethod ! . priceTotal * 2 ) } ' ) ,
style: TextStyle ( fontSize: 16.0 , letterSpacing: - 0.64 , fontWeight: FontWeight . bold ) ,
) ,
] ,
)
] ,
) ,
) ,
SizedBox (
height: 45 ,
height: 100 ,
) ,
if ( myAppointment ! = null )
SizedBox (
height: 100 ,
) ,
] ,
) ,
) ,
@ -510,62 +538,85 @@ class _PickupLocationState extends State<PickupLocation> {
bottomSheet: Container (
color: Theme . of ( context ) . scaffoldBackgroundColor ,
padding: EdgeInsets . all ( 12.0 ) ,
child: DefaultButton (
TranslationBase . of ( context ) . next ,
( ) {
if ( _result = = null | | _selectedHospital = = null )
AppToast . showErrorToast ( message: TranslationBase . of ( context ) . selectAll ) ;
else
setState ( ( ) {
widget . patientER_RC . transportationDetails ! . pickupSpot = _isInsideHome ? 1 : 0 ;
if ( widget . patientER_RC . transportationDetails ! . direction = = 0 ) {
/ / To Hospital
widget . patientER_RC . transportationDetails ! . dropoffLatitude = _result ! . lat . toStringAsFixed ( 6 ) ;
widget . patientER_RC . transportationDetails ! . dropoffLongitude = _result ! . long . toStringAsFixed ( 6 ) ;
widget . patientER_RC . transportationDetails ! . pickupLatitude = _selectedHospital ! . latitude ;
widget . patientER_RC . transportationDetails ! . pickupLongitude = _selectedHospital ! . longitude ;
} else {
/ / From Hospital
widget . patientER_RC . transportationDetails ! . pickupLatitude = _selectedHospital ! . latitude ;
widget . patientER_RC . transportationDetails ! . pickupLongitude = _selectedHospital ! . longitude ;
widget . patientER_RC . transportationDetails ! . dropoffLatitude = _result ! . lat . toStringAsFixed ( 6 ) ;
widget . patientER_RC . transportationDetails ! . dropoffLongitude = _result ! . long . toStringAsFixed ( 6 ) ;
}
child: Row (
children: [
Expanded (
flex: 1 ,
child: DefaultButton (
TranslationBase . of ( context ) . back ,
( ) {
widget . changeCurrentTab ( 0 ) ;
} ,
) ,
) ,
SizedBox ( width: 12.0 ) ,
Expanded (
flex: 1 ,
child: DefaultButton (
TranslationBase . of ( context ) . next ,
( ) {
if ( _result = = null | | _selectedHospital = = null )
AppToast . showErrorToast ( message: TranslationBase . of ( context ) . selectAll ) ;
else
setState ( ( ) {
widget . patientER_RC . transportationDetails ! . pickupSpot = _isInsideHome ? 1 : 0 ;
if ( widget . patientER_RC . transportationDetails ! . direction = = 0 ) {
/ / To Hospital
widget . patientER_RC . transportationDetails ! . dropoffLatitude = _result ! . lat . toStringAsFixed ( 6 ) ;
widget . patientER_RC . transportationDetails ! . dropoffLongitude = _result ! . long . toStringAsFixed ( 6 ) ;
widget . patientER_RC . transportationDetails ! . pickupLatitude = _selectedHospital ! . latitude ;
widget . patientER_RC . transportationDetails ! . pickupLongitude = _selectedHospital ! . longitude ;
} else {
/ / From Hospital
widget . patientER_RC . transportationDetails ! . pickupLatitude = _selectedHospital ! . latitude ;
widget . patientER_RC . transportationDetails ! . pickupLongitude = _selectedHospital ! . longitude ;
widget . patientER_RC . transportationDetails ! . dropoffLatitude = _result ! . lat . toStringAsFixed ( 6 ) ;
widget . patientER_RC . transportationDetails ! . dropoffLongitude = _result ! . long . toStringAsFixed ( 6 ) ;
}
widget . patientER_RC . transportationDetails ! . dropoffLocationName = widget . patientER_RC . transportationDetails ! . direction = = 1 ? _result ! . formattedAddress : _selectedHospital ! . name ;
widget . patientER_RC . transportationDetails ! . dropoffLocationName = widget . patientER_RC . transportationDetails ! . direction = = 1 ? _result ! . formattedAddress : _selectedHospital ! . name ;
widget . patientER_RC . patientIdentificationID = widget . amRequestViewModel . user . patientIdentificationNo ;
widget . patientER_RC . transportationDetails ! . pickupDateTime = DateUtil . convertDateToStringLocation ( DateTime . now ( ) ) ;
widget . patientER_RC . transportationDetails ! . pickupLocationName = widget . patientER_RC . transportationDetails ! . direction = = 1 ? _selectedHospital ! . name : _result ! . formattedAddress ;
widget . patientER_RC . projectID = widget . amRequestViewModel . user . projectID ;
widget . patientER_RC . patientID = widget . amRequestViewModel . user . patientID ;
widget . patientER_RC . transportationDetails ! . requesterIsOutSA = false ;
widget . patientER_RC . transportationDetails ! . requesterMobileNo = widget . amRequestViewModel . user . mobileNumber ;
widget . patientER_RC . transportationDetails ! . requesterFileNo = widget . amRequestViewModel . user . patientID ;
widget . patientER_RC . patientIdentificationID = widget . amRequestViewModel . user . patientIdentificationNo ;
widget . patientER_RC . transportationDetails ! . pickupDateTime = DateUtil . convertDateToStringLocation ( DateTime . now ( ) ) ;
widget . patientER_RC . transportationDetails ! . pickupLocationName = widget . patientER_RC . transportationDetails ! . direction = = 1 ? _selectedHospital ! . name : _result ! . formattedAddress ;
widget . patientER_RC . projectID = widget . amRequestViewModel . user . projectID ;
widget . patientER_RC . patientID = widget . amRequestViewModel . user . patientID ;
widget . patientER_RC . transportationDetails ! . requesterIsOutSA = false ;
widget . patientER_RC . transportationDetails ! . requesterMobileNo = widget . amRequestViewModel . user . mobileNumber ;
widget . patientER_RC . transportationDetails ! . requesterFileNo = widget . amRequestViewModel . user . patientID ;
if ( _haveAppointment = = HaveAppointment . YES ) {
widget . patientER_RC . transportationDetails ! . appointmentNo = myAppointment ! . appointmentNo . toString ( ) ;
widget . patientER_RC . transportationDetails ! . appointmentClinicName = myAppointment ! . clinicName ;
widget . patientER_RC . transportationDetails ! . appointmentDoctorName = myAppointment ! . doctorNameObj ;
widget . patientER_RC . transportationDetails ! . appointmentBranch = myAppointment ! . projectName ;
widget . patientER_RC . transportationDetails ! . appointmentTime = myAppointment ! . appointmentDate ;
widget . patientER_RC . transportationDetails ! . haveAppointment = 1 ;
widget . patientER_RC . transportationDetails ! . dropoffLatitude = myAppointment ! . latitude ;
widget . patientER_RC . transportationDetails ! . dropoffLongitude = myAppointment ! . longitude ;
widget . patientER_RC . transportationDetails ! . dropoffLocationName = myAppointment ! . projectName ;
} else {
widget . patientER_RC . transportationDetails ! . appointmentNo = " 0 " ;
widget . patientER_RC . transportationDetails ! . appointmentClinicName = " " ;
widget . patientER_RC . transportationDetails ! . appointmentDoctorName = " " ;
widget . patientER_RC . transportationDetails ! . appointmentBranch = " " ;
widget . patientER_RC . transportationDetails ! . appointmentTime = " " ;
widget . patientER_RC . transportationDetails ! . haveAppointment = 0 ;
}
if ( _haveAppointment = = HaveAppointment . YES ) {
widget . patientER_RC . transportationDetails ! . appointmentNo = myAppointment ! . appointmentNo . toString ( ) ;
widget . patientER_RC . transportationDetails ! . appointmentClinicName = myAppointment ! . clinicName ;
widget . patientER_RC . transportationDetails ! . appointmentDoctorName = myAppointment ! . doctorNameObj ;
widget . patientER_RC . transportationDetails ! . appointmentBranch = myAppointment ! . projectName ;
widget . patientER_RC . transportationDetails ! . appointmentTime = myAppointment ! . appointmentDate ;
widget . patientER_RC . transportationDetails ! . haveAppointment = 1 ;
widget . patientER_RC . transportationDetails ! . dropoffLatitude = myAppointment ! . latitude ;
widget . patientER_RC . transportationDetails ! . dropoffLongitude = myAppointment ! . longitude ;
widget . patientER_RC . transportationDetails ! . dropoffLocationName = myAppointment ! . projectName ;
} else {
widget . patientER_RC . transportationDetails ! . appointmentNo = " 0 " ;
widget . patientER_RC . transportationDetails ! . appointmentClinicName = " " ;
widget . patientER_RC . transportationDetails ! . appointmentDoctorName = " " ;
widget . patientER_RC . transportationDetails ! . appointmentBranch = " " ;
widget . patientER_RC . transportationDetails ! . appointmentTime = " " ;
widget . patientER_RC . transportationDetails ! . haveAppointment = 0 ;
}
widget . patientER_RC . transportationDetails ! . pickupSpot = _isInsideHome ? 1 : 0 ;
widget . changeCurrentTab ( 2 ) ;
} ) ;
} ,
widget . patientER_RC . transportationDetails ! . pickupSpot = _isInsideHome ? 1 : 0 ;
widget . patientER_RC . transportationDetails ! . ambulate = 3 ;
widget . patientER_RC . transportationDetails ! . ambulateTitle = " none " ;
widget . patientER_RC . transportationDetails ! . notes = " " ;
widget . changeCurrentTab ( 3 ) ;
} ) ;
} ,
color: CustomColors . green ,
) ,
) ,
] ,
) ,
) ,
) ;