2/7/1
This commit is contained in:
@@ -8,6 +8,7 @@ class BoxName {
|
||||
static const String agreeTerms = "agreeTerms";
|
||||
static const String addWork = 'addWork';
|
||||
static const String addHome = 'addHome';
|
||||
static const String tipAmount = 'tipAmount';
|
||||
static const String accountIdStripeConnect = "accountIdStripeConnect";
|
||||
static const String faceDetectTimes = "faceDetectTimes";
|
||||
static const String sosPhonePassenger = "sosPhonePassenger";
|
||||
|
||||
@@ -50,6 +50,8 @@ class AppLink {
|
||||
static String getRideOrderID = "$ride/rides/getRideOrderID.php";
|
||||
static String getRideStatus = "$ride/rides/getRideStatus.php";
|
||||
static String getRideStatusBegin = "$ride/rides/getRideStatusBegin.php";
|
||||
static String getRideStatusFromStartApp =
|
||||
"$ride/rides/getRideStatusFromStartApp.php";
|
||||
static String updateRides = "$ride/rides/update.php";
|
||||
static String deleteRides = "$ride/rides/delete.php";
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import 'package:flutter_local_notifications/flutter_local_notifications.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:ride/controller/functions/crud.dart';
|
||||
import 'package:ride/controller/functions/toast.dart';
|
||||
import 'package:ride/views/widgets/elevated_btn.dart';
|
||||
|
||||
import '../../constant/api_key.dart';
|
||||
@@ -183,33 +184,56 @@ class FirebaseMessagesController extends GetxController {
|
||||
// MapPassengerController mapController = Get.put(MapPassengerController());
|
||||
Get.snackbar('RideIsBegin', '', backgroundColor: AppColor.greenColor);
|
||||
// mapController.driverArrivePassenger();
|
||||
update();
|
||||
} else if (message.notification!.title!.contains('Hi ,I will go now')) {
|
||||
// MapPassengerController mapController = Get.put(MapPassengerController());
|
||||
Get.snackbar('Hi ,I will go now', '',
|
||||
backgroundColor: AppColor.greenColor);
|
||||
// mapController.driverArrivePassenger();
|
||||
update();
|
||||
} else if (message.notification!.title!
|
||||
.contains('Hi ,I Arrive your site')) {
|
||||
// MapPassengerController mapController = Get.put(MapPassengerController());
|
||||
Get.defaultDialog(
|
||||
barrierDismissible: false,
|
||||
title: 'Hi ,I Arrive your site'.tr,
|
||||
middleText: 'Please go to Car Driver'.tr,
|
||||
confirm: MyElevatedButton(
|
||||
title: 'Ok I will go now.'.tr,
|
||||
onPressed: () {
|
||||
FirebaseMessagesController().sendNotificationToPassengerToken(
|
||||
'Hi ,I will go now'.tr,
|
||||
'I will go now'.tr,
|
||||
Get.find<MapPassengerController>().driverToken, []);
|
||||
Get.back();
|
||||
}));
|
||||
|
||||
update();
|
||||
} else if (message.notification!.title!.contains('Driver Finish Trip')) {
|
||||
var myListString = message.data['passengerList'];
|
||||
var driverList = jsonDecode(myListString) as List<dynamic>;
|
||||
Get.defaultDialog(
|
||||
title: 'Driver Finish Trip'.tr,
|
||||
content: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'Your fee is ${Get.find<MapPassengerController>().totalPassenger.toStringAsFixed(2)}'),
|
||||
Text('Do you want to pay Tips for this Driver'.tr)
|
||||
],
|
||||
),
|
||||
content: DriverTipWidget(),
|
||||
confirm: MyElevatedButton(
|
||||
title: 'Yes'.tr,
|
||||
onPressed: () async {
|
||||
var tip = (Get.find<MapPassengerController>().totalPassenger) *
|
||||
(double.parse(box.read(BoxName.tipAmount.toString())));
|
||||
var res = await CRUD().post(link: AppLink.addTips, payload: {
|
||||
'passengerID': box.read(BoxName.passengerID),
|
||||
'driverID': driverList[0].toString(),
|
||||
'rideID': driverList[1].toString(),
|
||||
'tipAmount': '1',
|
||||
'tipAmount': tip.toString(),
|
||||
});
|
||||
await CRUD().post(link: AppLink.addPassengersWallet, payload: {
|
||||
'passenger_id': box.read(BoxName.passengerID).toString(),
|
||||
'balance': ((-1) * tip).toString()
|
||||
});
|
||||
if (res != 'failure') {
|
||||
FirebaseMessagesController().sendNotificationToAnyWithoutData(
|
||||
'You Have Tips',
|
||||
'1\$ tips',
|
||||
'${tip.toString()}\$ tips\nTotal is ${tip + (Get.find<MapPassengerController>().totalPassenger)}',
|
||||
driverList[2].toString(),
|
||||
);
|
||||
}
|
||||
@@ -223,7 +247,8 @@ class FirebaseMessagesController extends GetxController {
|
||||
cancel: MyElevatedButton(
|
||||
title: 'No,I want'.tr,
|
||||
onPressed: () {
|
||||
Get.offAll(() => RateCaptainFromPassenger());
|
||||
Get.back();
|
||||
Get.off(() => RateCaptainFromPassenger());
|
||||
},
|
||||
kolor: AppColor.redColor,
|
||||
));
|
||||
@@ -411,3 +436,98 @@ class FirebaseMessagesController extends GetxController {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class DriverTipWidget extends StatelessWidget {
|
||||
const DriverTipWidget({
|
||||
super.key,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'Your fee is ${Get.find<MapPassengerController>().totalPassenger.toStringAsFixed(2)}'),
|
||||
Text('Do you want to pay Tips for this Driver'.tr),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () {
|
||||
box.write(BoxName.tipAmount, '0.05');
|
||||
Toast.show(
|
||||
context,
|
||||
'Tip is ${(Get.find<MapPassengerController>().totalPassenger) * (double.parse(box.read(BoxName.tipAmount.toString())))}',
|
||||
AppColor.blueColor);
|
||||
},
|
||||
child: Container(
|
||||
decoration: BoxDecoration(border: Border.all()),
|
||||
child: const Padding(
|
||||
padding: EdgeInsets.all(4),
|
||||
child: Center(
|
||||
child: Text('5%'),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
box.write(BoxName.tipAmount, '0.10');
|
||||
Toast.show(
|
||||
context,
|
||||
'Tip is ${(Get.find<MapPassengerController>().totalPassenger) * (double.parse(box.read(BoxName.tipAmount.toString())))}',
|
||||
AppColor.blueColor);
|
||||
},
|
||||
child: Container(
|
||||
decoration: BoxDecoration(border: Border.all()),
|
||||
child: const Center(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(5),
|
||||
child: Text('10%'),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
box.write(BoxName.tipAmount, '0.15');
|
||||
Toast.show(
|
||||
context,
|
||||
'Tip is ${(Get.find<MapPassengerController>().totalPassenger) * (double.parse(box.read(BoxName.tipAmount.toString())))}',
|
||||
AppColor.blueColor);
|
||||
},
|
||||
child: Container(
|
||||
decoration: BoxDecoration(border: Border.all()),
|
||||
child: const Center(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(5),
|
||||
child: Text('15%'),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
box.write(BoxName.tipAmount, '0.20');
|
||||
Toast.show(
|
||||
context,
|
||||
'Tip is ${(Get.find<MapPassengerController>().totalPassenger) * (double.parse(box.read(BoxName.tipAmount.toString())))}',
|
||||
AppColor.blueColor);
|
||||
},
|
||||
child: Container(
|
||||
decoration: BoxDecoration(border: Border.all()),
|
||||
child: const Center(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(5),
|
||||
child: Text('20%'),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -154,7 +154,7 @@ class CRUD {
|
||||
},
|
||||
);
|
||||
print(response.request);
|
||||
//print(payload);
|
||||
print(payload);
|
||||
|
||||
var jsonData = jsonDecode(response.body);
|
||||
if (response.statusCode == 200) {
|
||||
|
||||
@@ -57,18 +57,23 @@ class MapDriverController extends GetxController {
|
||||
late String direction;
|
||||
late String durationOfRideValue;
|
||||
late String status;
|
||||
int timeWaitingPassenger = 5; //5 miniute
|
||||
bool isPassengerInfoWindow = false;
|
||||
bool isBtnRideBegin = false;
|
||||
bool isArrivedSend = true;
|
||||
bool isBtnPassengerWait = false;
|
||||
bool isRideFinished = false;
|
||||
bool isRideStarted = false;
|
||||
double passengerInfoWindow = Get.height * .35;
|
||||
double driverEndPage = 100;
|
||||
double progress = 0;
|
||||
double progressToPassenger = 0;
|
||||
double progressInPassengerLocationFromDriver = 0;
|
||||
bool isRideBegin = false;
|
||||
int progressTimerToShowPassengerInfoWindowFromDriver = 25;
|
||||
int remainingTimeToShowPassengerInfoWindowFromDriver = 25;
|
||||
int remainingTimeToPassenger = 60;
|
||||
int remainingTimeInPassengerLocatioWait = 60;
|
||||
bool isDriverNearPassengerStart = false;
|
||||
GoogleMapController? mapController;
|
||||
late LatLng myLocation;
|
||||
@@ -196,6 +201,31 @@ class MapDriverController extends GetxController {
|
||||
}
|
||||
}
|
||||
|
||||
String stringRemainingTimeWaitingPassenger = '';
|
||||
|
||||
void startTimerToShowDriverWaitPassengerDuration() async {
|
||||
for (int i = 0; i <= timeWaitingPassenger * 60; i++) {
|
||||
await Future.delayed(const Duration(seconds: 1));
|
||||
progressInPassengerLocationFromDriver = i / (timeWaitingPassenger * 60);
|
||||
remainingTimeInPassengerLocatioWait = (timeWaitingPassenger * 60) - i;
|
||||
if (remainingTimeInPassengerLocatioWait == 0) {
|
||||
isBtnPassengerWait = true;
|
||||
print(isBtnPassengerWait);
|
||||
update();
|
||||
}
|
||||
print(isBtnPassengerWait);
|
||||
print(
|
||||
'remainingTimeInPassengerLocatioWait $remainingTimeInPassengerLocatioWait');
|
||||
|
||||
int minutes = (remainingTimeInPassengerLocatioWait / 60).floor();
|
||||
int seconds = remainingTimeInPassengerLocatioWait % 60;
|
||||
stringRemainingTimeWaitingPassenger =
|
||||
'$minutes:${seconds.toString().padLeft(2, '0')}';
|
||||
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
void driverGoToPassenger() async {
|
||||
changeRideToBeginToPassenger();
|
||||
await CRUD().post(link: AppLink.updateRides, payload: {
|
||||
|
||||
@@ -17,9 +17,11 @@ class OrderRequestController extends GetxController {
|
||||
String countRefuse = '0';
|
||||
bool applied = false;
|
||||
final locationController = Get.put(LocationController());
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
getRefusedOrderByCaptain();
|
||||
|
||||
update();
|
||||
super.onInit();
|
||||
}
|
||||
|
||||
@@ -220,9 +220,11 @@ class MapPassengerController extends GetxController {
|
||||
clearPolyline();
|
||||
isMarkersShown = false;
|
||||
isWayPointStopsSheetUtilGetMap = false;
|
||||
isWayPointSheet = false;
|
||||
durationToRide = 0;
|
||||
distanceOfDestnation = 0;
|
||||
wayPointSheetHeight = 0;
|
||||
remainingTime = 25;
|
||||
haveSteps = true;
|
||||
|
||||
// Filter out empty value
|
||||
@@ -447,7 +449,7 @@ class MapPassengerController extends GetxController {
|
||||
|
||||
String stringRemainingTimeToPassenger = '';
|
||||
|
||||
void startTimerToPassengerFromDriverAfterApplied() async {
|
||||
void startTimerFromDriverToPassengerAfterApplied() async {
|
||||
for (int i = 0; i <= timeToPassengerFromDriverAfterApplied; i++) {
|
||||
await Future.delayed(const Duration(seconds: 1));
|
||||
progressTimerToPassengerFromDriverAfterApplied =
|
||||
@@ -466,6 +468,16 @@ class MapPassengerController extends GetxController {
|
||||
int seconds = remainingTimeToPassengerFromDriverAfterApplied % 60;
|
||||
stringRemainingTimeToPassenger =
|
||||
'$minutes:${seconds.toString().padLeft(2, '0')}';
|
||||
|
||||
// var cameraUpdate = CameraUpdate.newLatLngZoom(
|
||||
// driverLocationToPassenger,
|
||||
// 17,
|
||||
// );
|
||||
// mapController!.animateCamera(cameraUpdate);
|
||||
|
||||
// print(driverCarsLocationToPassengerAfterApplied);
|
||||
// print(driverCarsLocationToPassengerAfterApplied[0]);
|
||||
|
||||
update();
|
||||
}
|
||||
}
|
||||
@@ -531,10 +543,38 @@ class MapPassengerController extends GetxController {
|
||||
timeToPassengerFromDriverAfterApplied = 0;
|
||||
remainingTime = 0;
|
||||
remainingTimeToPassengerFromDriverAfterApplied = 0;
|
||||
rideTimerBegin = true;
|
||||
update();
|
||||
// isCancelRidePageShown = true;
|
||||
rideIsBeginPassengerTimer();
|
||||
// //print('rideTimerBegin: $rideTimerBegin');
|
||||
rideTimerBegin = true;
|
||||
}
|
||||
} catch (e) {
|
||||
//print('Error: $e');
|
||||
// Handle the error or perform any necessary actions
|
||||
}
|
||||
}
|
||||
|
||||
void getRideStatusFromStartApp() async {
|
||||
try {
|
||||
var res = await CRUD().get(
|
||||
link: AppLink.getRideStatusFromStartApp,
|
||||
payload: {'passenger_id': box.read(BoxName.passengerID)});
|
||||
if (res == 'failure') {
|
||||
//print(res);
|
||||
}
|
||||
var decode = jsonDecode(res);
|
||||
|
||||
if (decode['data']['status'] == 'Begin') {
|
||||
getMap(
|
||||
decode['data']['start_location'], decode['data']['end_location']);
|
||||
// timeToPassengerFromDriverAfterApplied = 0;
|
||||
// remainingTime = 0;
|
||||
// remainingTimeToPassengerFromDriverAfterApplied = 0;
|
||||
// // isCancelRidePageShown = true;
|
||||
// rideIsBeginPassengerTimer();
|
||||
// // //print('rideTimerBegin: $rideTimerBegin');
|
||||
// rideTimerBegin = true;
|
||||
update();
|
||||
}
|
||||
} catch (e) {
|
||||
@@ -610,6 +650,8 @@ class MapPassengerController extends GetxController {
|
||||
late String model;
|
||||
late String licensePlate;
|
||||
changeConfirmRide() async {
|
||||
await getCarsLocationByPassenger();
|
||||
|
||||
if (dataCarsLocationByPassenger != 'failure') {
|
||||
driverToken =
|
||||
dataCarsLocationByPassenger['message'][carsOrder]['token'].toString();
|
||||
@@ -633,7 +675,6 @@ class MapPassengerController extends GetxController {
|
||||
update();
|
||||
// //print('rideConfirm= $rideConfirm');
|
||||
|
||||
await getCarsLocationByPassenger();
|
||||
await CRUD().post(link: AppLink.addRides, payload: {
|
||||
"start_location": //'${data[0]['start_address']}',
|
||||
'${data[0]["start_location"]['lat']},${data[0]["start_location"]['lng']}',
|
||||
@@ -772,7 +813,7 @@ class MapPassengerController extends GetxController {
|
||||
|
||||
// //print('timeToPassengerFromDriverAfterApplied====' +
|
||||
// timeToPassengerFromDriverAfterApplied.toString());
|
||||
startTimerToPassengerFromDriverAfterApplied();
|
||||
startTimerFromDriverToPassengerAfterApplied();
|
||||
update();
|
||||
}
|
||||
update();
|
||||
@@ -839,23 +880,25 @@ class MapPassengerController extends GetxController {
|
||||
}
|
||||
}
|
||||
|
||||
late LatLng driverLocationToPassenger = LatLng(32, 35);
|
||||
Future getDriverCarsLocationToPassengerAfterApplied() async {
|
||||
driverCarsLocationToPassengerAfterApplied = [];
|
||||
|
||||
var res = await CRUD().get(
|
||||
link: AppLink.getDriverCarsLocationToPassengerAfterApplied,
|
||||
payload: {
|
||||
'driver_id': dataCarsLocationByPassenger['message'][carsOrder]
|
||||
['driver_id']
|
||||
});
|
||||
payload: {'driver_id': driverId});
|
||||
|
||||
datadriverCarsLocationToPassengerAfterApplied = jsonDecode(res);
|
||||
|
||||
driverLocationToPassenger = LatLng(
|
||||
double.parse(datadriverCarsLocationToPassengerAfterApplied['message'][0]
|
||||
['latitude']),
|
||||
double.parse(datadriverCarsLocationToPassengerAfterApplied['message'][0]
|
||||
['longitude']));
|
||||
driverCarsLocationToPassengerAfterApplied.add(LatLng(
|
||||
double.parse(datadriverCarsLocationToPassengerAfterApplied['message']
|
||||
[carsOrder]['latitude']),
|
||||
double.parse(datadriverCarsLocationToPassengerAfterApplied['message']
|
||||
[carsOrder]['longitude'])));
|
||||
double.parse(datadriverCarsLocationToPassengerAfterApplied['message'][0]
|
||||
['latitude']),
|
||||
double.parse(datadriverCarsLocationToPassengerAfterApplied['message'][0]
|
||||
['longitude'])));
|
||||
|
||||
update();
|
||||
}
|
||||
@@ -939,7 +982,7 @@ class MapPassengerController extends GetxController {
|
||||
// clearPolylineAll();
|
||||
data = [];
|
||||
changeCancelRidePageShow();
|
||||
if (rideId != '') {
|
||||
if (rideId != 'yet') {
|
||||
await CRUD().post(link: AppLink.updateDriverOrder, payload: {
|
||||
"order_id": rideId.toString(), // Convert to String
|
||||
"status": 'Cancel'
|
||||
@@ -957,6 +1000,7 @@ class MapPassengerController extends GetxController {
|
||||
// totalStepDurations = 0;
|
||||
timeToPassengerFromDriverAfterApplied = 0;
|
||||
remainingTime = 0;
|
||||
isWayPointStopsSheetUtilGetMap = false;
|
||||
update();
|
||||
} else {
|
||||
clearPlacesDestination();
|
||||
@@ -969,6 +1013,7 @@ class MapPassengerController extends GetxController {
|
||||
FirebaseMessagesController().sendNotificationToDriverMAP(
|
||||
'Cancel Trip', 'Trip Cancelled'.tr, driverToken, []);
|
||||
isPickerShown = false;
|
||||
isWayPointStopsSheetUtilGetMap = false;
|
||||
rideConfirm = false;
|
||||
shouldFetch = false;
|
||||
isCashConfirmPageShown = false;
|
||||
@@ -1008,7 +1053,7 @@ class MapPassengerController extends GetxController {
|
||||
} else {
|
||||
isMainBottomMenuMap = !isMainBottomMenuMap;
|
||||
mainBottomMenuMapHeight =
|
||||
isMainBottomMenuMap == true ? Get.height * .2 : Get.height * .5;
|
||||
isMainBottomMenuMap == true ? Get.height * .2 : Get.height * .6;
|
||||
isWayPointSheet = false;
|
||||
if (heightMenuBool == true) {
|
||||
getDrawerMenu();
|
||||
@@ -1021,10 +1066,13 @@ class MapPassengerController extends GetxController {
|
||||
void downPoints() {
|
||||
if (Get.find<WayPointController>().wayPoints.length < 2) {
|
||||
isWayPointStopsSheetUtilGetMap = false;
|
||||
changeWayPointStopsSheet();
|
||||
isWayPointSheet = false;
|
||||
wayPointSheetHeight = isWayPointStopsSheet ? Get.height * .45 : 0;
|
||||
// changeWayPointStopsSheet();
|
||||
update();
|
||||
}
|
||||
changeWayPointStopsSheet();
|
||||
// changeWayPointStopsSheet();
|
||||
// isWayPointSheet = false;
|
||||
update();
|
||||
}
|
||||
|
||||
@@ -1475,6 +1523,7 @@ class MapPassengerController extends GetxController {
|
||||
|
||||
late LatLngBounds boundsData;
|
||||
getMap(String origin, destination) async {
|
||||
remainingTime = 25; //to make cancel every call
|
||||
await getCarsLocationByPassenger();
|
||||
// //print(carsLocationByPassenger);
|
||||
var coordDestination = destination.split(',');
|
||||
@@ -1694,7 +1743,7 @@ class MapPassengerController extends GetxController {
|
||||
print('boundsbounds');
|
||||
|
||||
// Fit the camera to the bounds
|
||||
var cameraUpdate = CameraUpdate.newLatLngBounds(bounds, 160);
|
||||
var cameraUpdate = CameraUpdate.newLatLngBounds(bounds, 180);
|
||||
mapController!.animateCamera(cameraUpdate);
|
||||
update();
|
||||
}
|
||||
|
||||
@@ -40,8 +40,9 @@ class CaptainWalletController extends GetxController {
|
||||
walletDriverPointsDate = jsonDecode(res);
|
||||
if (walletDriverPointsDate['message'][0]['driverID'].toString() ==
|
||||
box.read(BoxName.driverID)) {
|
||||
totalPoints =
|
||||
walletDriverPointsDate['message'][0]['total_amount'].toString();
|
||||
double totalPointsDouble = double.parse(
|
||||
walletDriverPointsDate['message'][0]['total_amount'].toString());
|
||||
totalPoints = totalPointsDouble.toStringAsFixed(0);
|
||||
} else {
|
||||
totalPoints = '0';
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:animated_text_kit/animated_text_kit.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_font_icons/flutter_font_icons.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:ride/constant/box_name.dart';
|
||||
import 'package:ride/constant/colors.dart';
|
||||
@@ -25,11 +26,11 @@ class PassengerInfoWindow extends StatelessWidget {
|
||||
children: [
|
||||
Positioned(
|
||||
bottom: 50,
|
||||
left: 8,
|
||||
// left: 8,
|
||||
child: AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 300),
|
||||
height: controller.passengerInfoWindow,
|
||||
width: Get.width * .8,
|
||||
width: Get.width * .96,
|
||||
decoration: AppStyle.boxDecoration,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
@@ -112,7 +113,7 @@ class PassengerInfoWindow extends StatelessWidget {
|
||||
'${'Hello this is Captain'.tr} ${box.read(BoxName.nameDriver)}');
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.whatshot,
|
||||
FontAwesome.whatsapp,
|
||||
color: AppColor.greenColor,
|
||||
)),
|
||||
IconButton(
|
||||
@@ -137,16 +138,6 @@ class PassengerInfoWindow extends StatelessWidget {
|
||||
Icons.email,
|
||||
color: AppColor.redColor,
|
||||
)),
|
||||
IconButton(
|
||||
onPressed: () =>
|
||||
FirebaseMessagesController()
|
||||
.sendNotificationToPassengerToken(
|
||||
'Hi',
|
||||
'body',
|
||||
controller.tokenPassenger,
|
||||
[]),
|
||||
icon:
|
||||
const Icon(Icons.notification_add))
|
||||
],
|
||||
),
|
||||
controller.remainingTimeToPassenger != 0
|
||||
@@ -175,12 +166,92 @@ class PassengerInfoWindow extends StatelessWidget {
|
||||
)
|
||||
: controller.isRideBegin
|
||||
? const SizedBox()
|
||||
: MyElevatedButton(
|
||||
title: 'Start the Ride'.tr,
|
||||
kolor: AppColor.greenColor,
|
||||
onPressed: () {
|
||||
controller.startRideFromDriver();
|
||||
}),
|
||||
: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
MyElevatedButton(
|
||||
title: 'Start the Ride'.tr,
|
||||
kolor: AppColor.greenColor,
|
||||
onPressed: () {
|
||||
Get.defaultDialog(
|
||||
title:
|
||||
'Is the Passenger in your Car ?'
|
||||
.tr,
|
||||
middleText:
|
||||
'don\'t start trip if not '
|
||||
.tr,
|
||||
confirm: MyElevatedButton(
|
||||
title: 'OK'.tr,
|
||||
onPressed: () {
|
||||
controller
|
||||
.startRideFromDriver();
|
||||
Get.back();
|
||||
}),
|
||||
cancel: MyElevatedButton(
|
||||
title:
|
||||
'No ,still Waiting.'
|
||||
.tr,
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
}));
|
||||
}),
|
||||
controller.isArrivedSend
|
||||
? MyElevatedButton(
|
||||
title: 'I arrive you'.tr,
|
||||
kolor: AppColor.yellowColor,
|
||||
onPressed: () {
|
||||
FirebaseMessagesController()
|
||||
.sendNotificationToPassengerToken(
|
||||
'Hi ,I Arrive your site'
|
||||
.tr,
|
||||
'I Arrive your site'
|
||||
.tr,
|
||||
controller
|
||||
.tokenPassenger,
|
||||
[]);
|
||||
controller
|
||||
.startTimerToShowDriverWaitPassengerDuration();
|
||||
controller.isArrivedSend =
|
||||
false;
|
||||
})
|
||||
: const SizedBox(),
|
||||
],
|
||||
),
|
||||
controller.remainingTimeInPassengerLocatioWait <
|
||||
300
|
||||
? Stack(
|
||||
children: [
|
||||
LinearProgressIndicator(
|
||||
backgroundColor:
|
||||
AppColor.accentColor,
|
||||
color: controller
|
||||
.remainingTimeInPassengerLocatioWait <
|
||||
60
|
||||
? AppColor.redColor
|
||||
: AppColor.greenColor,
|
||||
minHeight: 50,
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
15),
|
||||
value: controller
|
||||
.progressInPassengerLocationFromDriver
|
||||
.toDouble(),
|
||||
),
|
||||
Center(
|
||||
child: Text(
|
||||
controller
|
||||
.stringRemainingTimeWaitingPassenger,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
: const SizedBox(),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -24,6 +24,9 @@ class OrderRequestPage extends StatelessWidget {
|
||||
final myListString = arguments['myListString'];
|
||||
final myList = arguments['DriverList'];
|
||||
final body = arguments['body'];
|
||||
Duration durationToAdd = Duration(seconds: int.parse(myList[4]));
|
||||
int hours = durationToAdd.inHours;
|
||||
int minutes = (durationToAdd.inMinutes % 60).round();
|
||||
orderRequestController.startTimer(myList[6].toString(), body.toString());
|
||||
return MyScafolld(
|
||||
title: 'Order Request Page'.tr,
|
||||
@@ -167,8 +170,10 @@ class OrderRequestPage extends StatelessWidget {
|
||||
style: AppStyle.title,
|
||||
children: [
|
||||
TextSpan(
|
||||
text: myList[4].toString(),
|
||||
style: AppStyle.headTitle2),
|
||||
text: hours > 1
|
||||
? '${'Your Ride Duration is '.tr}$hours H and $minutes m'
|
||||
: '${'Your Ride Duration is '.tr} $minutes m',
|
||||
style: AppStyle.title),
|
||||
TextSpan(text: ' Minutes'.tr, style: AppStyle.title),
|
||||
]),
|
||||
),
|
||||
|
||||
@@ -30,6 +30,7 @@ class MainBottomMenuMap extends StatelessWidget {
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(15),
|
||||
@@ -288,6 +289,7 @@ class MainBottomMenuMap extends StatelessWidget {
|
||||
controller.currentLocationToFormPlaces =
|
||||
false;
|
||||
controller.placesDestination = [];
|
||||
// controller.isCancelRidePageShown = true;
|
||||
controller.clearPlacesStart();
|
||||
controller.clearPlacesDestination();
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ class PointsPageForRider extends StatelessWidget {
|
||||
left: 2,
|
||||
right: 2,
|
||||
child: AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 800),
|
||||
duration: const Duration(milliseconds: 300),
|
||||
height: controller.wayPointSheetHeight,
|
||||
decoration: AppStyle.boxDecoration,
|
||||
child: ListView(
|
||||
|
||||
@@ -3,8 +3,8 @@ import 'package:get/get.dart';
|
||||
import 'package:ride/constant/box_name.dart';
|
||||
import 'package:ride/constant/colors.dart';
|
||||
import 'package:ride/constant/style.dart';
|
||||
import 'package:ride/controller/home/map_passenger_controller.dart';
|
||||
import 'package:ride/controller/home/payment/captain_wallet_controller.dart';
|
||||
import 'package:ride/controller/home/payment/credit_card_controller.dart';
|
||||
import 'package:ride/controller/payment/payment_controller.dart';
|
||||
import 'package:ride/main.dart';
|
||||
import 'package:ride/views/widgets/elevated_btn.dart';
|
||||
@@ -19,6 +19,7 @@ class WaletCaptain extends StatelessWidget {
|
||||
Get.put(CaptainWalletController());
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Get.put(MapPassengerController());
|
||||
return MyScafolld(
|
||||
title: 'Captain Wallet'.tr,
|
||||
body: [
|
||||
|
||||
Reference in New Issue
Block a user