3/25/1
This commit is contained in:
@@ -14,6 +14,7 @@ import '../../../main.dart';
|
||||
import '../../../views/home/my_wallet/walet_captain.dart';
|
||||
import '../../../views/widgets/elevated_btn.dart';
|
||||
import '../../functions/crud.dart';
|
||||
import '../../functions/location_background_controller.dart';
|
||||
import '../../functions/location_controller.dart';
|
||||
import '../payment/captain_wallet_controller.dart';
|
||||
|
||||
@@ -39,6 +40,7 @@ class HomeCaptainController extends GetxController {
|
||||
double widthMapTypeAndTraffic = 50;
|
||||
// Inject the LocationController class
|
||||
final locationController = Get.put(LocationController());
|
||||
// final locationBackController = Get.put(LocationBackgroundController());
|
||||
String formatDuration(Duration duration) {
|
||||
String twoDigits(int n) => n.toString().padLeft(2, "0");
|
||||
String twoDigitMinutes = twoDigits(duration.inMinutes.remainder(60));
|
||||
@@ -60,6 +62,7 @@ class HomeCaptainController extends GetxController {
|
||||
if (isActive) {
|
||||
if (double.parse(totalPoints) > -300) {
|
||||
locationController.startLocationUpdates();
|
||||
// locationBackController.startBackLocation();
|
||||
activeStartTime = DateTime.now();
|
||||
activeTimer = Timer.periodic(const Duration(seconds: 1), (timer) {
|
||||
activeDuration = DateTime.now().difference(activeStartTime!);
|
||||
|
||||
@@ -546,7 +546,10 @@ update ui for totla results
|
||||
// }));
|
||||
// }
|
||||
// add wallet from passenger from driver
|
||||
Get.to(() => RatePassenger());
|
||||
Get.to(() => RatePassenger(), arguments: {
|
||||
'passengerId': passengerId,
|
||||
'rideId': rideId,
|
||||
});
|
||||
// Get.back();
|
||||
}
|
||||
|
||||
@@ -653,22 +656,24 @@ update ui for totla results
|
||||
final previousLocationOfDrivers = await sql.getCustomQuery('''SELECT
|
||||
*
|
||||
FROM
|
||||
${TableName.carLocations}
|
||||
${TableName.rideLocation}
|
||||
WHERE
|
||||
order_id = $rideId
|
||||
ORDER BY
|
||||
created_at DESC
|
||||
LIMIT
|
||||
1''');
|
||||
|
||||
print(previousLocationOfDrivers);
|
||||
//get from sql
|
||||
if (previousLocationOfDrivers.isNotEmpty) {
|
||||
var lat = double.parse(previousLocationOfDrivers[0]['lat']);
|
||||
var lng = double.parse(previousLocationOfDrivers[0]['lng']);
|
||||
LatLng prev = LatLng(lat, lng);
|
||||
recentAngelToMarker = calculateAngleBetweenLocations(prev, myLocation);
|
||||
|
||||
recentDistanceToDash =
|
||||
calculateDistanceBetweenLocations(prev, myLocation);
|
||||
print('recentAngelToMarker $recentAngelToMarker');
|
||||
print('recentDistanceToDash $recentDistanceToDash');
|
||||
}
|
||||
sql.insertData({
|
||||
'order_id': rideId,
|
||||
@@ -683,7 +688,7 @@ LIMIT
|
||||
position: locationController.myLocation,
|
||||
draggable: true,
|
||||
icon: carIcon,
|
||||
rotation: recentAngelToMarker,
|
||||
rotation: locationController.heading,
|
||||
// infoWindow: const InfoWindow(
|
||||
// title: 'Time',
|
||||
// ),
|
||||
@@ -724,7 +729,7 @@ LIMIT
|
||||
|
||||
void addCustomEndIcon() {
|
||||
ImageConfiguration config = ImageConfiguration(
|
||||
size: const Size(30, 30), devicePixelRatio: Get.pixelRatio);
|
||||
size: const Size(25, 25), devicePixelRatio: Get.pixelRatio);
|
||||
BitmapDescriptor.fromAssetImage(config, 'assets/images/b.png',
|
||||
mipmaps: false)
|
||||
.then((value) {
|
||||
|
||||
Reference in New Issue
Block a user