12/24/1
This commit is contained in:
@@ -1,31 +1,42 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:SEFER/views/widgets/my_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:SEFER/constant/box_name.dart';
|
||||
import 'package:SEFER/constant/links.dart';
|
||||
import 'package:SEFER/controller/functions/crud.dart';
|
||||
import 'package:SEFER/main.dart';
|
||||
|
||||
import '../../views/widgets/mydialoug.dart';
|
||||
|
||||
class PassengerWalletHistoryController extends GetxController {
|
||||
bool isLoading = false;
|
||||
List archive = [];
|
||||
|
||||
getArchivePayment() async {
|
||||
isLoading = true;
|
||||
update();
|
||||
var res = await CRUD().get(
|
||||
link: AppLink.getPassengerWalletArchive,
|
||||
payload: {'passenger_id': box.read(BoxName.passengerID)});
|
||||
if (res != 'failure') {
|
||||
archive = jsonDecode(res)['message'];
|
||||
isLoading = false;
|
||||
Future<void> getArchivePayment() async {
|
||||
try {
|
||||
isLoading = true;
|
||||
update();
|
||||
} else {
|
||||
MyDialog().getDialog('No wallet record found'.tr, '', () {
|
||||
Get.back();
|
||||
|
||||
var res = await CRUD().get(
|
||||
link: AppLink.getPassengerWalletArchive,
|
||||
payload: {'passenger_id': box.read(BoxName.passengerID)},
|
||||
);
|
||||
|
||||
if (res != 'failure') {
|
||||
archive = jsonDecode(res)['message'];
|
||||
} else {
|
||||
MyDialog().getDialog('No wallet record found'.tr, '', () {
|
||||
Get.back();
|
||||
Get.back();
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
MyDialog().getDialog('An error occurred'.tr, e.toString(), () {
|
||||
Get.back();
|
||||
});
|
||||
} finally {
|
||||
isLoading = false;
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user