This commit is contained in:
Hamza-Ayed
2023-09-15 21:36:45 +03:00
parent 58aa82c3f3
commit 9aa1d3091e
8 changed files with 47 additions and 35 deletions

View File

@@ -100,14 +100,25 @@ class LoginCaptinController extends GetxController {
}
}
// goToMapPage() {
// if (box.read(BoxName.email) != null) {
// Get.offAll(() => const MapPage());
// }
// }
void loginByBoxData() async {
isloading = true;
update();
await CRUD().post(link: AppLink.addTokensDriver, payload: {
'token': box.read(BoxName.tokenDriver).toString(),
'captain_id': box.read(BoxName.driverID).toString()
});
isloading = false;
update();
}
@override
void onInit() {
super.onInit();
if (box.read(BoxName.driverID) != null ||
box.read(BoxName.driverID) != '') {
loginByBoxData();
}
}
}