4/4/2
This commit is contained in:
@@ -23,10 +23,14 @@ class HistoryCaptainController extends GetxController {
|
|||||||
var res = await CRUD().get(
|
var res = await CRUD().get(
|
||||||
link: AppLink.getDriverOrder,
|
link: AppLink.getDriverOrder,
|
||||||
payload: {'driver_id': box.read(BoxName.driverID)});
|
payload: {'driver_id': box.read(BoxName.driverID)});
|
||||||
|
if (res != 'failure') {
|
||||||
historyData = jsonDecode(res);
|
historyData = jsonDecode(res);
|
||||||
print(historyData);
|
print(historyData);
|
||||||
isloading = false;
|
isloading = false;
|
||||||
update();
|
update();
|
||||||
|
} else {
|
||||||
|
Get.defaultDialog(title: 'Not found');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getHistoryDetails(String orderId) async {
|
getHistoryDetails(String orderId) async {
|
||||||
|
|||||||
@@ -2345,7 +2345,7 @@ class MapPassengerController extends GetxController {
|
|||||||
link: AppLink.getPassengerRate,
|
link: AppLink.getPassengerRate,
|
||||||
payload: {'passenger_id': box.read(BoxName.passengerID)});
|
payload: {'passenger_id': box.read(BoxName.passengerID)});
|
||||||
if (res != 'failure') {
|
if (res != 'failure') {
|
||||||
passengerRate = double.parse(jsonDecode(res)['message']['rating']);
|
passengerRate = jsonDecode(res)['message']['rating'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2354,6 +2354,11 @@ class MapPassengerController extends GetxController {
|
|||||||
mapAPIKEY = await storage.read(key: BoxName.mapAPIKEY);
|
mapAPIKEY = await storage.read(key: BoxName.mapAPIKEY);
|
||||||
getFavioratePlaces();
|
getFavioratePlaces();
|
||||||
readyWayPoints();
|
readyWayPoints();
|
||||||
|
addCustomPicker();
|
||||||
|
addCustomCarIcon();
|
||||||
|
addCustomStepIcon();
|
||||||
|
addCustomStartIcon();
|
||||||
|
addCustomEndIcon();
|
||||||
await getLocation();
|
await getLocation();
|
||||||
await addToken();
|
await addToken();
|
||||||
await getKazanPercent();
|
await getKazanPercent();
|
||||||
@@ -2361,11 +2366,6 @@ class MapPassengerController extends GetxController {
|
|||||||
startMarkerReloading();
|
startMarkerReloading();
|
||||||
// await getCarsLocationByPassenger();
|
// await getCarsLocationByPassenger();
|
||||||
// await getNearestDriverByPassengerLocation();
|
// await getNearestDriverByPassengerLocation();
|
||||||
addCustomPicker();
|
|
||||||
addCustomCarIcon();
|
|
||||||
addCustomStepIcon();
|
|
||||||
addCustomStartIcon();
|
|
||||||
addCustomEndIcon();
|
|
||||||
|
|
||||||
initilizeGetStorage();
|
initilizeGetStorage();
|
||||||
cardNumber = await SecureStorage().readData(BoxName.cardNumber);
|
cardNumber = await SecureStorage().readData(BoxName.cardNumber);
|
||||||
|
|||||||
@@ -478,10 +478,12 @@ class MyTranslation extends Translations {
|
|||||||
'Distance from Passenger to destination is ':
|
'Distance from Passenger to destination is ':
|
||||||
"المسافة من الراكب إلى الوجهة هي ",
|
"المسافة من الراكب إلى الوجهة هي ",
|
||||||
'Cost Of Trip IS ': "تكلفة الرحلة هي ",
|
'Cost Of Trip IS ': "تكلفة الرحلة هي ",
|
||||||
|
'No ride found yet': 'لا يوجد طلبات متوفرة حاليا',
|
||||||
'Accept Order': "اقبل الطلب",
|
'Accept Order': "اقبل الطلب",
|
||||||
'reject your order.': "رفض طلبك.",
|
'reject your order.': "رفض طلبك.",
|
||||||
'Bottom Bar Example': "مثال لشريط الأسفل",
|
'Bottom Bar Example': "مثال لشريط الأسفل",
|
||||||
'Statistics': "الإحصائيات",'Available for rides':'مشاوير متاحة',
|
'Statistics': "الإحصائيات",
|
||||||
|
'Available for rides': 'مشاوير متاحة',
|
||||||
'Scan Id': "مسح الهوية",
|
'Scan Id': "مسح الهوية",
|
||||||
'Camera not initilaized yet': "الكاميرا لم تُثبت بعد",
|
'Camera not initilaized yet': "الكاميرا لم تُثبت بعد",
|
||||||
'Scan ID MklGoogle': "مسح هوية MklGoogle",
|
'Scan ID MklGoogle': "مسح هوية MklGoogle",
|
||||||
|
|||||||
@@ -39,8 +39,8 @@ class DrawerCaptain extends StatelessWidget {
|
|||||||
color: AppColor.greenColor,
|
color: AppColor.greenColor,
|
||||||
gradient: LinearGradient(
|
gradient: LinearGradient(
|
||||||
colors: [
|
colors: [
|
||||||
AppColor.greenColor,
|
AppColor.primaryColor,
|
||||||
AppColor.yellowColor,
|
AppColor.secondaryColor,
|
||||||
],
|
],
|
||||||
begin: Alignment.topLeft,
|
begin: Alignment.topLeft,
|
||||||
end: Alignment.bottomRight,
|
end: Alignment.bottomRight,
|
||||||
@@ -100,9 +100,11 @@ class DrawerCaptain extends StatelessWidget {
|
|||||||
GetBuilder<ImageController>(builder: (imageController) {
|
GetBuilder<ImageController>(builder: (imageController) {
|
||||||
return imageController.isloading
|
return imageController.isloading
|
||||||
? const MyCircularProgressIndicator()
|
? const MyCircularProgressIndicator()
|
||||||
: ClipOval(
|
: CircleAvatar(
|
||||||
child: Image.network(
|
radius: 45,
|
||||||
'${AK.serverPHP}/portrate_captain_image/${box.read(BoxName.driverID)}.jpg'));
|
backgroundImage: NetworkImage(
|
||||||
|
'${AK.serverPHP}/portrate_captain_image/${box.read(BoxName.driverID)}.jpg'),
|
||||||
|
);
|
||||||
}),
|
}),
|
||||||
Positioned(
|
Positioned(
|
||||||
right: 0,
|
right: 0,
|
||||||
|
|||||||
@@ -420,7 +420,7 @@ class OrderRequestPage extends StatelessWidget {
|
|||||||
myList[33].toString(),
|
myList[33].toString(),
|
||||||
myList[2].toString(),
|
myList[2].toString(),
|
||||||
myList[5].toString(),
|
myList[5].toString(),
|
||||||
myList[4].toString());
|
myList[4].toString()); //duration
|
||||||
},
|
},
|
||||||
kolor: AppColor.redColor,
|
kolor: AppColor.redColor,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -32,7 +32,19 @@ class AvailableRidesPage extends StatelessWidget {
|
|||||||
? const MyCircularProgressIndicator()
|
? const MyCircularProgressIndicator()
|
||||||
: Padding(
|
: Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: ListView.builder(
|
child: rideAvailableController
|
||||||
|
.rideAvalibleMap['message'].length ==
|
||||||
|
1 &&
|
||||||
|
rideAvailableController.rideAvalibleMap['message']
|
||||||
|
[0]['start_location'] ==
|
||||||
|
null
|
||||||
|
? Center(
|
||||||
|
child: Text(
|
||||||
|
'No ride found yet'.tr,
|
||||||
|
style: AppStyle.headTitle2,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: ListView.builder(
|
||||||
itemCount: rideAvailableController
|
itemCount: rideAvailableController
|
||||||
.rideAvalibleMap['message'].length,
|
.rideAvalibleMap['message'].length,
|
||||||
itemBuilder: (BuildContext context, int index) {
|
itemBuilder: (BuildContext context, int index) {
|
||||||
@@ -42,7 +54,8 @@ class AvailableRidesPage extends StatelessWidget {
|
|||||||
width: Get.width * .9,
|
width: Get.width * .9,
|
||||||
decoration: AppStyle.boxDecoration1,
|
decoration: AppStyle.boxDecoration1,
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.spaceAround,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
' ${list['start_location']}',
|
' ${list['start_location']}',
|
||||||
@@ -57,12 +70,13 @@ class AvailableRidesPage extends StatelessWidget {
|
|||||||
mainAxisAlignment:
|
mainAxisAlignment:
|
||||||
MainAxisAlignment.spaceAround,
|
MainAxisAlignment.spaceAround,
|
||||||
children: [
|
children: [
|
||||||
Text('${'Price: '.tr}${list['price']} \$'),
|
Text(
|
||||||
|
'${'Price: '.tr}${list['price']} \$'),
|
||||||
const SizedBox(height: 4),
|
const SizedBox(height: 4),
|
||||||
Text(
|
Text(
|
||||||
'${list['carType']}',
|
'${list['carType']}',
|
||||||
style: AppStyle.title
|
style: AppStyle.title.copyWith(
|
||||||
.copyWith(color: AppColor.greenColor),
|
color: AppColor.greenColor),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -76,17 +90,19 @@ class AvailableRidesPage extends StatelessWidget {
|
|||||||
title: 'Accept'.tr,
|
title: 'Accept'.tr,
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
box.write(
|
box.write(
|
||||||
BoxName.statusDriverLocation, 'on');
|
BoxName.statusDriverLocation,
|
||||||
|
'on');
|
||||||
|
|
||||||
var res = await CRUD().post(
|
var res = await CRUD().post(
|
||||||
link: AppLink.updateStausFromSpeed,
|
link: AppLink
|
||||||
|
.updateStausFromSpeed,
|
||||||
payload: {
|
payload: {
|
||||||
'id': list['id'],
|
'id': list['id'],
|
||||||
'rideTimeStart':
|
'rideTimeStart':
|
||||||
DateTime.now().toString(),
|
DateTime.now().toString(),
|
||||||
'status': 'Apply',
|
'status': 'Apply',
|
||||||
'driver_id':
|
'driver_id': box
|
||||||
box.read(BoxName.driverID),
|
.read(BoxName.driverID),
|
||||||
});
|
});
|
||||||
// .then((value) {
|
// .then((value) {
|
||||||
// var json = jsonDecode(res);
|
// var json = jsonDecode(res);
|
||||||
@@ -98,7 +114,8 @@ class AvailableRidesPage extends StatelessWidget {
|
|||||||
.tr,
|
.tr,
|
||||||
middleText: '',
|
middleText: '',
|
||||||
titleStyle: AppStyle.title,
|
titleStyle: AppStyle.title,
|
||||||
middleTextStyle: AppStyle.title,
|
middleTextStyle:
|
||||||
|
AppStyle.title,
|
||||||
confirm: MyElevatedButton(
|
confirm: MyElevatedButton(
|
||||||
title: 'Ok'.tr,
|
title: 'Ok'.tr,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
@@ -106,7 +123,8 @@ class AvailableRidesPage extends StatelessWidget {
|
|||||||
Get.back();
|
Get.back();
|
||||||
Get.back();
|
Get.back();
|
||||||
}));
|
}));
|
||||||
} else if (jsonDecode(res)['status'] ==
|
} else if (jsonDecode(
|
||||||
|
res)['status'] ==
|
||||||
"success") {
|
"success") {
|
||||||
List<String> bodyToPassenger = [
|
List<String> bodyToPassenger = [
|
||||||
box
|
box
|
||||||
@@ -122,8 +140,8 @@ class AvailableRidesPage extends StatelessWidget {
|
|||||||
await CRUD().postFromDialogue(
|
await CRUD().postFromDialogue(
|
||||||
link: AppLink.addDriverOrder,
|
link: AppLink.addDriverOrder,
|
||||||
payload: {
|
payload: {
|
||||||
'driver_id':
|
'driver_id': box
|
||||||
box.read(BoxName.driverID),
|
.read(BoxName.driverID),
|
||||||
// box.read(BoxName.driverID).toString(),
|
// box.read(BoxName.driverID).toString(),
|
||||||
'order_id': list['id'],
|
'order_id': list['id'],
|
||||||
'status': 'Apply'
|
'status': 'Apply'
|
||||||
@@ -134,13 +152,15 @@ class AvailableRidesPage extends StatelessWidget {
|
|||||||
'Apply Ride',
|
'Apply Ride',
|
||||||
'your ride is applied'.tr,
|
'your ride is applied'.tr,
|
||||||
// arguments['DriverList'][9].toString(),
|
// arguments['DriverList'][9].toString(),
|
||||||
list['passengerToken'].toString(),
|
list['passengerToken']
|
||||||
|
.toString(),
|
||||||
// box.read(BoxName.tokenDriver).toString(),
|
// box.read(BoxName.tokenDriver).toString(),
|
||||||
bodyToPassenger,
|
bodyToPassenger,
|
||||||
);
|
);
|
||||||
Get.back();
|
Get.back();
|
||||||
Get.to(
|
Get.to(
|
||||||
() => PassengerLocationMapPage(),
|
() =>
|
||||||
|
PassengerLocationMapPage(),
|
||||||
arguments: {
|
arguments: {
|
||||||
'passengerLocation':
|
'passengerLocation':
|
||||||
list['start_location']
|
list['start_location']
|
||||||
@@ -148,18 +168,18 @@ class AvailableRidesPage extends StatelessWidget {
|
|||||||
'passengerDestination':
|
'passengerDestination':
|
||||||
list['end_location']
|
list['end_location']
|
||||||
.toString(),
|
.toString(),
|
||||||
'Duration':
|
'Duration': list['duration']
|
||||||
list['duration'].toString(),
|
.toString(),
|
||||||
'totalCost':
|
'totalCost': list['price']
|
||||||
list['price'].toString(),
|
.toString(),
|
||||||
'Distance':
|
'Distance': list['distance']
|
||||||
list['distance'].toString(),
|
.toString(),
|
||||||
'name': list['first_name']
|
'name': list['first_name']
|
||||||
.toString(),
|
.toString(),
|
||||||
'phone':
|
'phone': list['phone']
|
||||||
list['phone'].toString(),
|
.toString(),
|
||||||
'email':
|
'email': list['email']
|
||||||
list['email'].toString(),
|
.toString(),
|
||||||
'WalletChecked':
|
'WalletChecked':
|
||||||
list['payment_method']
|
list['payment_method']
|
||||||
.toString(),
|
.toString(),
|
||||||
@@ -169,8 +189,10 @@ class AvailableRidesPage extends StatelessWidget {
|
|||||||
'direction':
|
'direction':
|
||||||
'https://www.google.com/maps/dir/${list['start_location']}/${list['end_location']}/',
|
'https://www.google.com/maps/dir/${list['start_location']}/${list['end_location']}/',
|
||||||
'DurationToPassenger':
|
'DurationToPassenger':
|
||||||
list['duration'].toString(),
|
list['duration']
|
||||||
'rideId': list['id'].toString(),
|
.toString(),
|
||||||
|
'rideId':
|
||||||
|
list['id'].toString(),
|
||||||
'passengerId':
|
'passengerId':
|
||||||
list['passenger_id']
|
list['passenger_id']
|
||||||
.toString(),
|
.toString(),
|
||||||
@@ -178,9 +200,11 @@ class AvailableRidesPage extends StatelessWidget {
|
|||||||
.read(BoxName.driverID)
|
.read(BoxName.driverID)
|
||||||
.toString(),
|
.toString(),
|
||||||
'durationOfRideValue':
|
'durationOfRideValue':
|
||||||
list['duration'].toString(),
|
list['duration']
|
||||||
|
.toString(),
|
||||||
'paymentAmount':
|
'paymentAmount':
|
||||||
list['price'].toString(),
|
list['price']
|
||||||
|
.toString(),
|
||||||
'paymentMethod':
|
'paymentMethod':
|
||||||
'cash'.toString() == //todo fix payment method
|
'cash'.toString() == //todo fix payment method
|
||||||
'true'
|
'true'
|
||||||
@@ -196,11 +220,13 @@ class AvailableRidesPage extends StatelessWidget {
|
|||||||
'passengerWalletBurc':
|
'passengerWalletBurc':
|
||||||
list['bruc'].toString(),
|
list['bruc'].toString(),
|
||||||
'timeOfOrder':
|
'timeOfOrder':
|
||||||
DateTime.now().toString(),
|
DateTime.now()
|
||||||
|
.toString(),
|
||||||
'totalPassenger':
|
'totalPassenger':
|
||||||
list['price'].toString(),
|
list['price']
|
||||||
'carType':
|
.toString(),
|
||||||
list['carType'].toString(),
|
'carType': list['carType']
|
||||||
|
.toString(),
|
||||||
'kazan': Get.find<
|
'kazan': Get.find<
|
||||||
HomeCaptainController>()
|
HomeCaptainController>()
|
||||||
.kazan
|
.kazan
|
||||||
@@ -212,8 +238,8 @@ class AvailableRidesPage extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
'📍 ${list['distance']} ${'KM'.tr}',
|
'📍 ${list['distance']} ${'KM'.tr}',
|
||||||
style: AppStyle.title
|
style: AppStyle.title.copyWith(
|
||||||
.copyWith(color: AppColor.greenColor),
|
color: AppColor.greenColor),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user