9/8/1-captin
This commit is contained in:
@@ -28,7 +28,7 @@ class OrderHistoryController extends GetxController {
|
||||
var jsonDecoded = jsonDecode(res);
|
||||
|
||||
orderHistoryListPassenger = jsonDecoded['data'];
|
||||
print(orderHistoryListPassenger);
|
||||
// print(orderHistoryListPassenger);
|
||||
isloading = false;
|
||||
update();
|
||||
}
|
||||
|
||||
32
lib/controller/home/profile/promos_controller.dart
Normal file
32
lib/controller/home/profile/promos_controller.dart
Normal file
@@ -0,0 +1,32 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:get/get.dart';
|
||||
import 'package:ride/constant/links.dart';
|
||||
import 'package:ride/controller/functions/crud.dart';
|
||||
|
||||
class PromosController extends GetxController {
|
||||
List<dynamic> promoList = [];
|
||||
bool isloading = true;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
getPromoBytody();
|
||||
super.onInit();
|
||||
}
|
||||
|
||||
Future getPromoBytody() async {
|
||||
var res = await CRUD().get(link: AppLink.getPromoBytody, payload: {});
|
||||
if (res.toString() == 'failure') {
|
||||
Get.snackbar('failure', 'message');
|
||||
isloading = false;
|
||||
update();
|
||||
} else {
|
||||
var jsonDecoded = jsonDecode(res);
|
||||
|
||||
promoList = jsonDecoded['message'];
|
||||
print(promoList);
|
||||
isloading = false;
|
||||
update();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user