44 lines
1.1 KiB
Dart
44 lines
1.1 KiB
Dart
import 'dart:convert';
|
|
|
|
import 'package:Tripz/views/widgets/elevated_btn.dart';
|
|
import 'package:get/get.dart';
|
|
import 'package:Tripz/constant/box_name.dart';
|
|
import 'package:Tripz/constant/links.dart';
|
|
import 'package:Tripz/controller/functions/crud.dart';
|
|
import 'package:Tripz/main.dart';
|
|
|
|
class DriverWalletHistoryController extends GetxController {
|
|
bool isLoading = false;
|
|
List archive = [];
|
|
|
|
getArchivePayment() async {
|
|
isLoading = true;
|
|
update();
|
|
var res = await CRUD().get(
|
|
link: AppLink.getWalletByDriver,
|
|
payload: {'driverID': box.read(BoxName.driverID)});
|
|
if (res == 'failure') {
|
|
Get.defaultDialog(
|
|
barrierDismissible: false,
|
|
title: 'There is no data yet.'.tr,
|
|
middleText: '',
|
|
confirm: MyElevatedButton(
|
|
title: 'Back'.tr,
|
|
onPressed: () {
|
|
Get.back();
|
|
Get.back();
|
|
},
|
|
));
|
|
}
|
|
archive = jsonDecode(res)['message'];
|
|
isLoading = false;
|
|
update();
|
|
}
|
|
|
|
@override
|
|
void onInit() {
|
|
getArchivePayment();
|
|
super.onInit();
|
|
}
|
|
}
|