28 lines
611 B
Dart
28 lines
611 B
Dart
import 'dart:convert';
|
|
|
|
import 'package:get/get.dart';
|
|
|
|
import '../../constant/colors.dart';
|
|
import '../../constant/links.dart';
|
|
import '../functions/crud.dart';
|
|
|
|
class Driverthebest extends GetxController {
|
|
bool isLoading = false;
|
|
List driver = [];
|
|
getBestDriver() async {
|
|
var res = await CRUD().get(link: AppLink.getBestDriver, payload: {});
|
|
if (res != 'failure') {
|
|
driver = jsonDecode(res)['message'];
|
|
update();
|
|
} else {
|
|
Get.snackbar('error', '', backgroundColor: AppColor.redColor);
|
|
}
|
|
}
|
|
|
|
@override
|
|
void onInit() {
|
|
getBestDriver();
|
|
super.onInit();
|
|
}
|
|
}
|