10/16/1
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import 'package:flutter_sms/flutter_sms.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:ride/constant/box_name.dart';
|
||||
import 'dart:async';
|
||||
@@ -62,14 +61,6 @@ class HomeCaptainController extends GetxController {
|
||||
super.onInit();
|
||||
}
|
||||
|
||||
void sendSMSToRecipents(String message, List<String> recipents) async {
|
||||
String _result = await sendSMS(message: message, recipients: recipents)
|
||||
.catchError((onError) {
|
||||
print(onError);
|
||||
});
|
||||
print(_result);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
activeTimer?.cancel();
|
||||
|
||||
@@ -17,10 +17,13 @@ import 'package:ride/views/Rate/rate_captain.dart';
|
||||
import 'package:ride/views/widgets/elevated_btn.dart';
|
||||
import '../../main.dart';
|
||||
import '../../models/model/locations.dart';
|
||||
import '../functions/launch.dart';
|
||||
|
||||
class MapPassengerController extends GetxController {
|
||||
bool isLoading = true;
|
||||
TextEditingController placeController = TextEditingController();
|
||||
TextEditingController sosPhonePassengerProfile = TextEditingController();
|
||||
final sosFormKey = GlobalKey<FormState>();
|
||||
List data = [];
|
||||
List<LatLng> bounds = [];
|
||||
List places = [];
|
||||
@@ -80,6 +83,9 @@ class MapPassengerController extends GetxController {
|
||||
double progressTimerRideBegin = 0;
|
||||
int remainingTimeTimerRideBegin = 60;
|
||||
String stringRemainingTimeRideBegin = '';
|
||||
late String rideId;
|
||||
late String driverToken;
|
||||
int carsOrder = 0;
|
||||
|
||||
void onChangedPassengerCount(int newValue) {
|
||||
selectedPassengerCount = newValue;
|
||||
@@ -116,6 +122,32 @@ class MapPassengerController extends GetxController {
|
||||
update();
|
||||
}
|
||||
|
||||
void sendSMS(String to) async {
|
||||
// Get the driver's phone number.
|
||||
String driverPhone =
|
||||
dataCarsLocationByPassenger['message'][carsOrder]['phone'].toString();
|
||||
|
||||
// Format the message.
|
||||
String message =
|
||||
'Hi! This is ${box.read(BoxName.name)}. I am using Sefer to ride with ${dataCarsLocationByPassenger['message'][carsOrder]['first_name'].toString()} as the driver. ${dataCarsLocationByPassenger['message'][carsOrder]['first_name'].toString()} is driving a ${dataCarsLocationByPassenger['message'][carsOrder]['model'].toString()} with license plate ${dataCarsLocationByPassenger['message'][carsOrder]['license_plate'].toString()}. I am currently located at $myLocation. If you need to reach me, please contact the driver directly at $driverPhone.';
|
||||
|
||||
// Launch the URL to send the SMS.
|
||||
launchCommunication('sms', to, message);
|
||||
}
|
||||
|
||||
void sendWhatsapp(String to) async {
|
||||
// Get the driver's phone number.
|
||||
String driverPhone =
|
||||
dataCarsLocationByPassenger['message'][carsOrder]['phone'].toString();
|
||||
|
||||
// Format the message.
|
||||
String message =
|
||||
'Hi! This is ${box.read(BoxName.name)}. I am using Sefer to ride with ${dataCarsLocationByPassenger['message'][carsOrder]['first_name'].toString()} as the driver. ${dataCarsLocationByPassenger['message'][carsOrder]['first_name'].toString()} is driving a ${dataCarsLocationByPassenger['message'][carsOrder]['model'].toString()} with license plate ${dataCarsLocationByPassenger['message'][carsOrder]['license_plate'].toString()}. I am currently located at $myLocation. If you need to reach me, please contact the driver directly at $driverPhone.';
|
||||
|
||||
// Launch the URL to send the SMS.
|
||||
launchCommunication('whatsapp', to, message);
|
||||
}
|
||||
|
||||
void changeCancelRidePageShow() {
|
||||
// rideConfirm == true
|
||||
// ?
|
||||
@@ -223,9 +255,6 @@ class MapPassengerController extends GetxController {
|
||||
update();
|
||||
}
|
||||
|
||||
late String rideId;
|
||||
late String driverToken;
|
||||
int carsOrder = 0;
|
||||
changeConfirmRide() async {
|
||||
PaymentController paymentController = Get.find<PaymentController>();
|
||||
rideConfirm = true;
|
||||
|
||||
@@ -15,7 +15,7 @@ class ProfileController extends GetxController {
|
||||
TextEditingController txtController = TextEditingController();
|
||||
List genders = ['Male', 'Female', 'Non-binary'];
|
||||
|
||||
String gender = '';
|
||||
String gender = 'Male';
|
||||
|
||||
void setGender(String value) {
|
||||
gender = value;
|
||||
|
||||
Reference in New Issue
Block a user