|
|
|
@ -122,6 +122,7 @@ class _UserPageState extends State<UserPage> {
|
|
|
|
|
_getRequests();
|
|
|
|
|
// await UserTool.userProvider.updateUserInfo();
|
|
|
|
|
if (UserTool.userProvider.isLogin) {
|
|
|
|
|
|
|
|
|
|
// var res=await apiClient.request(API.app.trialVip);
|
|
|
|
|
if (UserTool.userProvider.userInfo.isTrial == 0) {
|
|
|
|
|
showDialog(
|
|
|
|
@ -145,7 +146,9 @@ class _UserPageState extends State<UserPage> {
|
|
|
|
|
// UserTool.userProvider.userInfo.end * 1000,
|
|
|
|
|
// format: DateFormats.y_mo_d);
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
vle = false;
|
|
|
|
|
Get.to(()=>const LoginPage());
|
|
|
|
|
}
|
|
|
|
|
setState(() {});
|
|
|
|
|
},
|
|
|
|
@ -293,14 +296,17 @@ class _UserPageState extends State<UserPage> {
|
|
|
|
|
} else {
|
|
|
|
|
isVip = true;
|
|
|
|
|
vle = await service.isRunning();
|
|
|
|
|
_easyRefreshController.callRefresh();
|
|
|
|
|
}
|
|
|
|
|
//service.isRunning() as bool;
|
|
|
|
|
// endDate = DateUtil.formatDateMs(
|
|
|
|
|
// UserTool.userProvider.userInfo.end * 1000,
|
|
|
|
|
// format: DateFormats.y_mo_d);
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
vle = false;
|
|
|
|
|
}
|
|
|
|
|
//
|
|
|
|
|
setState(() {});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -420,20 +426,25 @@ class _UserPageState extends State<UserPage> {
|
|
|
|
|
print("true");
|
|
|
|
|
prefs.remove("kg");
|
|
|
|
|
prefs.setBool("kg", vle);
|
|
|
|
|
// Future.delayed(const Duration(seconds: 1), () async {
|
|
|
|
|
// service.startService();
|
|
|
|
|
// });
|
|
|
|
|
service.startService();
|
|
|
|
|
// WidgetsFlutterBinding.ensureInitialized();
|
|
|
|
|
// initializeService();
|
|
|
|
|
// UserTool.userProvider.setKg(vle)
|
|
|
|
|
// initializeService();
|
|
|
|
|
initializeService();
|
|
|
|
|
// initializeService();
|
|
|
|
|
BotToast.showText(text: " 你开启了该功能");
|
|
|
|
|
// initializeService();
|
|
|
|
|
// print("这是数据${prefs.getBool("kg")}");
|
|
|
|
|
} else {
|
|
|
|
|
prefs.remove("kg");
|
|
|
|
|
prefs.setBool("kg", vle);
|
|
|
|
|
// Future.delayed(const Duration(seconds: 1), () async {
|
|
|
|
|
// service.invoke("stopService");
|
|
|
|
|
// });
|
|
|
|
|
service.invoke("stopService");
|
|
|
|
|
|
|
|
|
|
///有问题??
|
|
|
|
|
// exit(0);
|
|
|
|
|
// UserTool.userProvider.setKg(vle);
|
|
|
|
@ -476,18 +487,24 @@ class _UserPageState extends State<UserPage> {
|
|
|
|
|
));
|
|
|
|
|
break;
|
|
|
|
|
case "卡密兑换":
|
|
|
|
|
|
|
|
|
|
Navigator.of(context)
|
|
|
|
|
.push(
|
|
|
|
|
MaterialPageRoute(builder: (_) => const UserCardPage()),
|
|
|
|
|
)
|
|
|
|
|
.then((val) => _easyRefreshController.callRefresh());
|
|
|
|
|
.then((val) => _getRequests()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// _easyRefreshController.callRefresh()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
child: Container(
|
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 32.w),
|
|
|
|
|
child: ListTile(
|
|
|
|
|