4/4/3
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
|
import 'package:SEFER/views/widgets/elevated_btn.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
import '../../../constant/box_name.dart';
|
import '../../../constant/box_name.dart';
|
||||||
@@ -29,7 +30,16 @@ class HistoryCaptainController extends GetxController {
|
|||||||
isloading = false;
|
isloading = false;
|
||||||
update();
|
update();
|
||||||
} else {
|
} else {
|
||||||
Get.defaultDialog(title: 'Not found');
|
Get.defaultDialog(
|
||||||
|
title: 'No ride yet'.tr,
|
||||||
|
middleText: '',
|
||||||
|
barrierDismissible: false,
|
||||||
|
confirm: MyElevatedButton(
|
||||||
|
title: 'Back'.tr,
|
||||||
|
onPressed: () {
|
||||||
|
Get.back();
|
||||||
|
Get.back();
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1246,6 +1246,8 @@ class MapPassengerController extends GetxController {
|
|||||||
"status": 'notApplyFromAnyDriver'
|
"status": 'notApplyFromAnyDriver'
|
||||||
});
|
});
|
||||||
rideConfirm = false;
|
rideConfirm = false;
|
||||||
|
statusRide == 'Cancel';
|
||||||
|
isSearchingWindow = false;
|
||||||
shouldFetch = false;
|
shouldFetch = false;
|
||||||
isPassengerChosen = false;
|
isPassengerChosen = false;
|
||||||
isCashConfirmPageShown = false;
|
isCashConfirmPageShown = false;
|
||||||
@@ -1279,6 +1281,7 @@ class MapPassengerController extends GetxController {
|
|||||||
shouldFetch = false;
|
shouldFetch = false;
|
||||||
isCashConfirmPageShown = false;
|
isCashConfirmPageShown = false;
|
||||||
isSearchingWindow = false;
|
isSearchingWindow = false;
|
||||||
|
statusRide = 'Cancel';
|
||||||
isPassengerChosen = false;
|
isPassengerChosen = false;
|
||||||
isCashSelectedBeforeConfirmRide = false;
|
isCashSelectedBeforeConfirmRide = false;
|
||||||
isPickerShown = false;
|
isPickerShown = false;
|
||||||
@@ -1308,6 +1311,7 @@ class MapPassengerController extends GetxController {
|
|||||||
isSearchingWindow = false;
|
isSearchingWindow = false;
|
||||||
isPassengerChosen = false;
|
isPassengerChosen = false;
|
||||||
isCashSelectedBeforeConfirmRide = false;
|
isCashSelectedBeforeConfirmRide = false;
|
||||||
|
statusRide = 'Cancel';
|
||||||
haveSteps = false;
|
haveSteps = false;
|
||||||
isMarkersShown = false;
|
isMarkersShown = false;
|
||||||
timeToPassengerFromDriverAfterApplied = 0;
|
timeToPassengerFromDriverAfterApplied = 0;
|
||||||
|
|||||||
@@ -10,11 +10,11 @@ import '../../main.dart';
|
|||||||
import '../functions/crud.dart';
|
import '../functions/crud.dart';
|
||||||
|
|
||||||
class NotificationCaptainController extends GetxController {
|
class NotificationCaptainController extends GetxController {
|
||||||
bool isloading = false;
|
bool isLoading = false;
|
||||||
Map notificationData = {};
|
Map notificationData = {};
|
||||||
|
|
||||||
getNotifications() async {
|
getNotifications() async {
|
||||||
isloading = true;
|
isLoading = true;
|
||||||
update();
|
update();
|
||||||
var res = await CRUD().get(
|
var res = await CRUD().get(
|
||||||
link: AppLink.getNotificationCaptain,
|
link: AppLink.getNotificationCaptain,
|
||||||
@@ -36,7 +36,7 @@ class NotificationCaptainController extends GetxController {
|
|||||||
// sql.insertData(notificationData['message'], TableName.captainNotification);
|
// sql.insertData(notificationData['message'], TableName.captainNotification);
|
||||||
|
|
||||||
// print(notificationData);
|
// print(notificationData);
|
||||||
isloading = false;
|
isLoading = false;
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,75 +21,85 @@ class HistoryCaptain extends StatelessWidget {
|
|||||||
builder: (historyCaptainController) => historyCaptainController
|
builder: (historyCaptainController) => historyCaptainController
|
||||||
.isloading
|
.isloading
|
||||||
? const MyCircularProgressIndicator()
|
? const MyCircularProgressIndicator()
|
||||||
: ListView.builder(
|
: historyCaptainController.historyData['message'].length < 1
|
||||||
itemCount:
|
? Center(
|
||||||
historyCaptainController.historyData['message'].length,
|
child: Text(
|
||||||
itemBuilder: (BuildContext context, int index) {
|
'No ride Yet.'.tr,
|
||||||
var list = historyCaptainController.historyData['message']
|
style: AppStyle.headTitle,
|
||||||
[index];
|
|
||||||
return InkWell(
|
|
||||||
onTap: () {
|
|
||||||
list['status'] != 'Cancel'
|
|
||||||
? historyCaptainController
|
|
||||||
.getHistoryDetails(list['order_id'])
|
|
||||||
: Get.defaultDialog(
|
|
||||||
title: 'This Trip Cancelled'.tr,
|
|
||||||
middleText: '',
|
|
||||||
titleStyle: AppStyle.title,
|
|
||||||
confirm: MyElevatedButton(
|
|
||||||
title: 'Ok'.tr,
|
|
||||||
onPressed: () => Get.back()));
|
|
||||||
},
|
|
||||||
child: Card(
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.all(8.0),
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
'OrderId'.tr,
|
|
||||||
style: AppStyle.title,
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
list['order_id'],
|
|
||||||
style: AppStyle.subtitle,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
'created time'.tr,
|
|
||||||
style: AppStyle.title,
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
list['created_at'],
|
|
||||||
style: AppStyle.subtitle,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
list['status'],
|
|
||||||
style: list['status'] == 'Apply'
|
|
||||||
? AppStyle.title
|
|
||||||
.copyWith(color: AppColor.greenColor)
|
|
||||||
: list['status'] == 'Refused'
|
|
||||||
? AppStyle.title.copyWith(
|
|
||||||
color: AppColor.redColor)
|
|
||||||
: AppStyle.title.copyWith(
|
|
||||||
color: AppColor.yellowColor),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
);
|
)
|
||||||
},
|
: ListView.builder(
|
||||||
))
|
itemCount: historyCaptainController
|
||||||
|
.historyData['message'].length,
|
||||||
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
var list = historyCaptainController
|
||||||
|
.historyData['message'][index];
|
||||||
|
return InkWell(
|
||||||
|
onTap: () {
|
||||||
|
list['status'] != 'Cancel'
|
||||||
|
? historyCaptainController
|
||||||
|
.getHistoryDetails(list['order_id'])
|
||||||
|
: Get.defaultDialog(
|
||||||
|
title: 'This Trip Cancelled'.tr,
|
||||||
|
middleText: '',
|
||||||
|
titleStyle: AppStyle.title,
|
||||||
|
confirm: MyElevatedButton(
|
||||||
|
title: 'Ok'.tr,
|
||||||
|
onPressed: () => Get.back()));
|
||||||
|
},
|
||||||
|
child: Card(
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Column(
|
||||||
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'OrderId'.tr,
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
list['order_id'],
|
||||||
|
style: AppStyle.subtitle,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Column(
|
||||||
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'created time'.tr,
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
list['created_at'],
|
||||||
|
style: AppStyle.subtitle,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
list['status'],
|
||||||
|
style: list['status'] == 'Apply'
|
||||||
|
? AppStyle.title.copyWith(
|
||||||
|
color: AppColor.greenColor)
|
||||||
|
: list['status'] == 'Refused'
|
||||||
|
? AppStyle.title.copyWith(
|
||||||
|
color: AppColor.redColor)
|
||||||
|
: AppStyle.title.copyWith(
|
||||||
|
color: AppColor.yellowColor),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
))
|
||||||
],
|
],
|
||||||
isleading: true,
|
isleading: true,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -70,8 +70,9 @@ GetBuilder<MapDriverController> driverEndRideBar() {
|
|||||||
Text(mapDriverController.price.toStringAsFixed(0)),
|
Text(mapDriverController.price.toStringAsFixed(0)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
mapDriverController.carType == 'Free Ride' ||
|
(mapDriverController.carType == 'Free Ride' ||
|
||||||
mapDriverController.carType == 'Comfort'
|
mapDriverController.carType == 'Comfort') &&
|
||||||
|
mapDriverController.remainingTimeTimerRideBegin > 60
|
||||||
? Row(
|
? Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ class NotificationCaptain extends StatelessWidget {
|
|||||||
body: [
|
body: [
|
||||||
GetBuilder<NotificationCaptainController>(
|
GetBuilder<NotificationCaptainController>(
|
||||||
builder: (notificationCaptainController) =>
|
builder: (notificationCaptainController) =>
|
||||||
notificationCaptainController.isloading
|
notificationCaptainController.isLoading
|
||||||
? const MyCircularProgressIndicator()
|
? const MyCircularProgressIndicator()
|
||||||
: SafeArea(
|
: SafeArea(
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
|
|||||||
Reference in New Issue
Block a user