From 912b2d4526c4e96a9ef0a66b8924935591b30528 Mon Sep 17 00:00:00 2001 From: Hamza Aleghwairyeen Date: Sun, 31 Mar 2024 15:15:41 +0300 Subject: [PATCH] 3/31/5 --- .../home/Captin/orderCaptin/order_speed_request.dart | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/views/home/Captin/orderCaptin/order_speed_request.dart b/lib/views/home/Captin/orderCaptin/order_speed_request.dart index 450a7bf..c895900 100644 --- a/lib/views/home/Captin/orderCaptin/order_speed_request.dart +++ b/lib/views/home/Captin/orderCaptin/order_speed_request.dart @@ -32,7 +32,8 @@ class OrderSpeedRequest extends StatelessWidget { 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()); + orderRequestController.startTimerSpeed( + myList[6].toString(), body.toString()); var coords = myList[0].split(','); var coordDestination = myList[1].split(','); BitmapDescriptor startIcon = BitmapDescriptor.defaultMarker; @@ -373,7 +374,8 @@ class OrderSpeedRequest extends StatelessWidget { }); // .then((value) { var json = jsonDecode(res); - if (res == "failure") { + print('res $json'); + if (json['status'] == "failure") { Get.defaultDialog( title: "This ride is already taken by another driver." @@ -440,19 +442,19 @@ class OrderSpeedRequest extends StatelessWidget { ), GetBuilder( builder: (timerController) { - final isNearEnd = timerController.remainingTime <= + final isNearEnd = timerController.remainingTimeSpeed <= 5; // Define a threshold for "near end" return Stack( alignment: Alignment.center, children: [ CircularProgressIndicator( - value: timerController.progress, + value: timerController.progressSpeed, // Set the color based on the "isNearEnd" condition color: isNearEnd ? Colors.red : Colors.blue, ), Text( - '${timerController.remainingTime}', + '${timerController.remainingTimeSpeed}', style: AppStyle.number, ), ],