1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| class APIService extends GetxService{ Future<APIService> init()async{ Get.put(HomeProvider()); return this; } HomeProvider getHomeProvider(){ return Get.find<HomeProvider>(); } @override void onInit() { // TODO: implement onInit print('APIService--onInit'); super.onInit(); } @override void onReady() { // TODO: implement onReady print('APIService--onReady'); super.onReady(); } @override void onClose() { // TODO: implement onClose print('APIService--onClose'); super.onClose(); } }
|