Update: 2026-07-02 15:35:12

This commit is contained in:
Hamza-Ayed
2026-07-02 15:35:12 +03:00
parent 2adf195b36
commit 75e6fc42d7
17 changed files with 389 additions and 19 deletions
@@ -802,6 +802,9 @@ class HomeCaptainController extends GetxController {
calculateConsumptionFuel() {
mpg = fuelPrice / 12; //todo in register car add mpg in box
}
// 🆕 Gamification Streak State
int streakCount = 0;
bool isZeroCommissionActive = false;
getCountRideToday() async {
var res = await CRUD().get(
@@ -811,6 +814,24 @@ class HomeCaptainController extends GetxController {
countRideToday = data['message'][0]['count'].toString();
update();
// Fetch Gamification Streak as well
getDriverStreak();
}
// 🆕 Fetch Driver Streak
getDriverStreak() async {
var res = await CRUD().get(
link: AppLink.getDriverStreak,
payload: {'driver_id': box.read(BoxName.driverID).toString()});
if (res != 'failure') {
var decode = jsonDecode(res);
if (decode['status'] == 'success') {
streakCount = decode['message']['streak_count'] ?? 0;
isZeroCommissionActive = decode['message']['is_zero_commission_active'] ?? false;
update();
}
}
}
getDriverRate() async {