|
|
|
@ -45,12 +45,8 @@ class _UserPageState extends State<UserPage> {
|
|
|
|
|
final userProvider = Provider.of<UserProvider>(Get.context!, listen: false);
|
|
|
|
|
bool isVip = false;
|
|
|
|
|
String? endDate;
|
|
|
|
|
final service = FlutterBackgroundService();
|
|
|
|
|
|
|
|
|
|
late bool vle = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
final service = FlutterBackgroundService();
|
|
|
|
|
final EasyRefreshController _easyRefreshController = EasyRefreshController();
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@ -59,15 +55,36 @@ class _UserPageState extends State<UserPage> {
|
|
|
|
|
super.dispose();
|
|
|
|
|
}
|
|
|
|
|
// _load() async {
|
|
|
|
|
// // print("123123131313131231231231231313123131232311313131231231");
|
|
|
|
|
// vle = await service.isRunning();
|
|
|
|
|
// }
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
super.initState();
|
|
|
|
|
UserTool.userProvider.updateUserInfo();
|
|
|
|
|
Future.delayed(
|
|
|
|
|
const Duration(milliseconds: 0),
|
|
|
|
|
() => setState(() async{
|
|
|
|
|
// _easyRefreshController.callRefresh();
|
|
|
|
|
// UserTool.userProvider.updateUserInfo();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return CloudScaffold(
|
|
|
|
|
systemStyle: const SystemUiOverlayStyle(
|
|
|
|
|
statusBarIconBrightness: Brightness.dark,
|
|
|
|
|
// systemNavigationBarColor: Colors.white,
|
|
|
|
|
),
|
|
|
|
|
path: Assets.images.bg.path,
|
|
|
|
|
bodyColor: Colors.white,
|
|
|
|
|
extendBody: true,
|
|
|
|
|
body: Expanded(child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child:EasyRefresh(
|
|
|
|
|
firstRefresh: true,
|
|
|
|
|
header: MaterialHeader(),
|
|
|
|
|
onRefresh: () async {
|
|
|
|
|
// _load();
|
|
|
|
|
// await UserTool.userProvider.updateUserInfo();
|
|
|
|
|
if (UserTool.userProvider.isLogin) {
|
|
|
|
|
// print(UserTool.userProvider.userInfo.end * 1000);
|
|
|
|
|
// print(DateTime.now().millisecondsSinceEpoch);
|
|
|
|
@ -79,27 +96,14 @@ class _UserPageState extends State<UserPage> {
|
|
|
|
|
vle = await service.isRunning();
|
|
|
|
|
}
|
|
|
|
|
//service.isRunning() as bool;
|
|
|
|
|
endDate = DateUtil.formatDateMs(
|
|
|
|
|
UserTool.userProvider.userInfo.end * 1000,
|
|
|
|
|
format: DateFormats.y_mo_d);
|
|
|
|
|
// endDate = DateUtil.formatDateMs(
|
|
|
|
|
// UserTool.userProvider.userInfo.end * 1000,
|
|
|
|
|
// format: DateFormats.y_mo_d);
|
|
|
|
|
} else {
|
|
|
|
|
vle = false;
|
|
|
|
|
}
|
|
|
|
|
}));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return CloudScaffold(
|
|
|
|
|
systemStyle: const SystemUiOverlayStyle(
|
|
|
|
|
statusBarIconBrightness: Brightness.dark,
|
|
|
|
|
// systemNavigationBarColor: Colors.white,
|
|
|
|
|
),
|
|
|
|
|
path: Assets.images.bg.path,
|
|
|
|
|
bodyColor: Colors.white,
|
|
|
|
|
extendBody: true,
|
|
|
|
|
body: Column(
|
|
|
|
|
children: [
|
|
|
|
|
setState(() {});
|
|
|
|
|
},child:ListView(children: [
|
|
|
|
|
_getUser(),
|
|
|
|
|
72.hb,
|
|
|
|
|
_getBanner(),
|
|
|
|
@ -128,9 +132,13 @@ class _UserPageState extends State<UserPage> {
|
|
|
|
|
color2: const Color(0xFFEBF5FF),
|
|
|
|
|
text: "退出登录",
|
|
|
|
|
)
|
|
|
|
|
: const SizedBox()
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
: const SizedBox()],) )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
),],
|
|
|
|
|
),)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -270,7 +278,7 @@ class _UserPageState extends State<UserPage> {
|
|
|
|
|
_getVip(),
|
|
|
|
|
16.hb,
|
|
|
|
|
Text(
|
|
|
|
|
isVip ? "$endDate到期" : "解锁全部功能",
|
|
|
|
|
isVip ? "${DateUtil.formatDateMs(UserTool.userProvider.userInfo.end * 1000, format: DateFormats.y_mo_d)}到期" : "解锁全部功能",
|
|
|
|
|
style: TextStyle(color: Colors.white, fontSize: BaseStyle.fontSize24),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|