refactor: migrate JWT storage to secure storage, update assets, and enhance login verification logic.

This commit is contained in:
Hamza-Ayed
2026-08-06 22:54:52 +03:00
parent 52101e650c
commit 97471fd2bd
12 changed files with 239 additions and 138 deletions
@@ -939,13 +939,18 @@ class HomeCaptainController extends GetxController {
bool isZeroCommissionActive = false;
getCountRideToday() async {
var res = await CRUD().get(
var res = await CRUD().getWallet(
link: AppLink.getCountRide,
payload: {'driver_id': box.read(BoxName.driverID).toString()});
data = jsonDecode(res);
countRideToday = data['message'][0]['count'].toString();
update();
if (res != 'failure' && res != 'token_expired' && res != 'rate_limited') {
try {
var dataDecoded = res is String ? jsonDecode(res) : res;
if (dataDecoded is Map && dataDecoded['status'] == 'success' && dataDecoded['message'] != null) {
countRideToday = dataDecoded['message'][0]['count'].toString();
update();
}
} catch (_) {}
}
// Fetch Gamification Streak as well
getDriverStreak();