12/12/3
This commit is contained in:
@@ -34,17 +34,17 @@ class LocationController extends GetxController {
|
|||||||
totalPoints = Get.find<CaptainWalletController>().totalPoints;
|
totalPoints = Get.find<CaptainWalletController>().totalPoints;
|
||||||
|
|
||||||
// if (isActive) {
|
// if (isActive) {
|
||||||
// if (double.parse(totalPoints) > -100) {
|
if (double.parse(totalPoints) > -100) {
|
||||||
print('total point is ll$totalPoints');
|
print('total point is ll$totalPoints');
|
||||||
await getLocation();
|
await getLocation();
|
||||||
|
|
||||||
await CRUD().post(link: AppLink.addCarsLocationByPassenger, payload: {
|
await CRUD().post(link: AppLink.addCarsLocationByPassenger, payload: {
|
||||||
'driver_id': box.read(BoxName.driverID).toString(),
|
'driver_id': box.read(BoxName.driverID).toString(),
|
||||||
'latitude': myLocation.latitude.toString(),
|
'latitude': myLocation.latitude.toString(),
|
||||||
'longitude': myLocation.longitude.toString(),
|
'longitude': myLocation.longitude.toString(),
|
||||||
'status': box.read(BoxName.statusDriverLocation).toString()
|
'status': box.read(BoxName.statusDriverLocation).toString()
|
||||||
});
|
});
|
||||||
// }
|
}
|
||||||
|
|
||||||
// }
|
// }
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
@@ -49,11 +49,8 @@ class HomeCaptainController extends GetxController {
|
|||||||
|
|
||||||
String stringActiveDuration = '';
|
String stringActiveDuration = '';
|
||||||
void onButtonSelected() {
|
void onButtonSelected() {
|
||||||
totalPoints = Get.find<CaptainWalletController>().totalPoints;
|
// totalPoints = Get.find<CaptainWalletController>().totalPoints;
|
||||||
// if (double.parse(totalPoints) > -100) {
|
|
||||||
// isActive = false;
|
|
||||||
// update();
|
|
||||||
// } else {
|
|
||||||
isActive = !isActive;
|
isActive = !isActive;
|
||||||
if (isActive) {
|
if (isActive) {
|
||||||
if (double.parse(totalPoints) > -100) {
|
if (double.parse(totalPoints) > -100) {
|
||||||
@@ -64,6 +61,14 @@ class HomeCaptainController extends GetxController {
|
|||||||
stringActiveDuration = formatDuration(activeDuration);
|
stringActiveDuration = formatDuration(activeDuration);
|
||||||
update();
|
update();
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
locationController.stopLocationUpdates();
|
||||||
|
|
||||||
|
activeStartTime = null;
|
||||||
|
activeTimer?.cancel();
|
||||||
|
savePeriod(activeDuration);
|
||||||
|
activeDuration = Duration.zero;
|
||||||
|
update();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
locationController.stopLocationUpdates();
|
locationController.stopLocationUpdates();
|
||||||
|
|||||||
@@ -7,8 +7,6 @@ import 'package:ride/constant/links.dart';
|
|||||||
import 'package:ride/controller/functions/crud.dart';
|
import 'package:ride/controller/functions/crud.dart';
|
||||||
import 'package:ride/main.dart';
|
import 'package:ride/main.dart';
|
||||||
|
|
||||||
import '../../../views/home/my_wallet/walet_captain.dart';
|
|
||||||
|
|
||||||
class CaptainWalletController extends GetxController {
|
class CaptainWalletController extends GetxController {
|
||||||
bool isLoading = false;
|
bool isLoading = false;
|
||||||
Map walletDate = {};
|
Map walletDate = {};
|
||||||
|
|||||||
@@ -147,6 +147,11 @@ class WaletCaptain extends StatelessWidget {
|
|||||||
))
|
))
|
||||||
],
|
],
|
||||||
isleading: true,
|
isleading: true,
|
||||||
|
action: InkWell(
|
||||||
|
onTap: () {
|
||||||
|
captainWalletController.getCaptainWalletFromBuyPoints();
|
||||||
|
},
|
||||||
|
child: const Icon(Icons.refresh)),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user