4/4/3
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:SEFER/views/widgets/elevated_btn.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../../constant/box_name.dart';
|
||||
@@ -29,7 +30,16 @@ class HistoryCaptainController extends GetxController {
|
||||
isloading = false;
|
||||
update();
|
||||
} 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'
|
||||
});
|
||||
rideConfirm = false;
|
||||
statusRide == 'Cancel';
|
||||
isSearchingWindow = false;
|
||||
shouldFetch = false;
|
||||
isPassengerChosen = false;
|
||||
isCashConfirmPageShown = false;
|
||||
@@ -1279,6 +1281,7 @@ class MapPassengerController extends GetxController {
|
||||
shouldFetch = false;
|
||||
isCashConfirmPageShown = false;
|
||||
isSearchingWindow = false;
|
||||
statusRide = 'Cancel';
|
||||
isPassengerChosen = false;
|
||||
isCashSelectedBeforeConfirmRide = false;
|
||||
isPickerShown = false;
|
||||
@@ -1308,6 +1311,7 @@ class MapPassengerController extends GetxController {
|
||||
isSearchingWindow = false;
|
||||
isPassengerChosen = false;
|
||||
isCashSelectedBeforeConfirmRide = false;
|
||||
statusRide = 'Cancel';
|
||||
haveSteps = false;
|
||||
isMarkersShown = false;
|
||||
timeToPassengerFromDriverAfterApplied = 0;
|
||||
|
||||
@@ -10,11 +10,11 @@ import '../../main.dart';
|
||||
import '../functions/crud.dart';
|
||||
|
||||
class NotificationCaptainController extends GetxController {
|
||||
bool isloading = false;
|
||||
bool isLoading = false;
|
||||
Map notificationData = {};
|
||||
|
||||
getNotifications() async {
|
||||
isloading = true;
|
||||
isLoading = true;
|
||||
update();
|
||||
var res = await CRUD().get(
|
||||
link: AppLink.getNotificationCaptain,
|
||||
@@ -36,7 +36,7 @@ class NotificationCaptainController extends GetxController {
|
||||
// sql.insertData(notificationData['message'], TableName.captainNotification);
|
||||
|
||||
// print(notificationData);
|
||||
isloading = false;
|
||||
isLoading = false;
|
||||
update();
|
||||
}
|
||||
|
||||
|
||||
@@ -21,75 +21,85 @@ class HistoryCaptain extends StatelessWidget {
|
||||
builder: (historyCaptainController) => historyCaptainController
|
||||
.isloading
|
||||
? const MyCircularProgressIndicator()
|
||||
: 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),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
: historyCaptainController.historyData['message'].length < 1
|
||||
? Center(
|
||||
child: Text(
|
||||
'No ride Yet.'.tr,
|
||||
style: AppStyle.headTitle,
|
||||
),
|
||||
);
|
||||
},
|
||||
))
|
||||
)
|
||||
: 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,
|
||||
);
|
||||
|
||||
@@ -70,8 +70,9 @@ GetBuilder<MapDriverController> driverEndRideBar() {
|
||||
Text(mapDriverController.price.toStringAsFixed(0)),
|
||||
],
|
||||
),
|
||||
mapDriverController.carType == 'Free Ride' ||
|
||||
mapDriverController.carType == 'Comfort'
|
||||
(mapDriverController.carType == 'Free Ride' ||
|
||||
mapDriverController.carType == 'Comfort') &&
|
||||
mapDriverController.remainingTimeTimerRideBegin > 60
|
||||
? Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
|
||||
@@ -17,7 +17,7 @@ class NotificationCaptain extends StatelessWidget {
|
||||
body: [
|
||||
GetBuilder<NotificationCaptainController>(
|
||||
builder: (notificationCaptainController) =>
|
||||
notificationCaptainController.isloading
|
||||
notificationCaptainController.isLoading
|
||||
? const MyCircularProgressIndicator()
|
||||
: SafeArea(
|
||||
child: ListView.builder(
|
||||
|
||||
Reference in New Issue
Block a user