This commit is contained in:
Hamza-Ayed
2025-08-04 22:43:04 +03:00
parent 83a97baed1
commit ba02d41e6d
35 changed files with 3437 additions and 2959 deletions

View File

@@ -8,6 +8,7 @@ import 'package:sefer_driver/controller/functions/crud.dart';
import '../../../constant/table_names.dart';
import '../../../main.dart';
import '../../../print.dart';
class DriverBehaviorController extends GetxController {
Future<List<Map<String, dynamic>>> getAllData() async {
@@ -27,16 +28,17 @@ class DriverBehaviorController extends GetxController {
);
if (response != 'failure') {
final json = jsonDecode(response.body);
final json = jsonDecode(response);
overallScore.value =
double.parse(json['data']['overall_behavior_score'].toString());
lastTrips.value = json['data']['last_10_trips'];
double.parse(json['message']['overall_behavior_score'].toString());
lastTrips.value = json['message']['last_10_trips'];
} else {
// Get.snackbar("Error", json['message'] ?? "Unknown error");
}
} catch (e) {
Get.snackbar("Error", "Exception: $e");
// Get.snackbar("Error", "Exception: $e");
Log.print('e: ${e}');
} finally {
isLoading.value = false;
}