更改图片位置

master
王亚玲 2 years ago
parent 0b7443f0d9
commit 68d49842cd

@ -61,18 +61,17 @@ void onStart(ServiceInstance service) async {
service.stopSelf(); service.stopSelf();
}); });
Timer.periodic(const Duration(seconds: 1), (timer) async { Timer.periodic(const Duration(seconds: 1), (timer) async {
final SharedPreferences prefs = await SharedPreferences.getInstance(); final SharedPreferences prefs = await SharedPreferences.getInstance();
CallState state = await Telephony.instance.callState; CallState state = await Telephony.instance.callState;
callState = state.name; callState = state.name;
String? ref=prefs.getString('refSms'); String? ref=prefs.getString('refSms');
String? con=prefs.getString('conSms'); String? con=prefs.getString('conSms');
print(ref); print("这是数据$ref");
// bool? kg= prefs.getBool("kg"); // bool? kg= prefs.getBool("kg");
// // bool? kg= prefs.getBool("kg"); // // bool? kg= prefs.getBool("kg");
print("这是数据${prefs.getBool("kg")}"); // print("这是数据${prefs.getBool("kg")}");
// print("这是数据$kg"); // print("这是数据$kg");
// kg = UserTool.userProvider.kg; // kg = UserTool.userProvider.kg;
// print("这是数据${prefs.getBool("kg")}"); // print("这是数据${prefs.getBool("kg")}");

@ -201,12 +201,13 @@ _getBody() {
), ),
], ],
),), ),),
const Spacer() const Spacer(),
,Image.asset( Padding(padding: EdgeInsets.only(top: 40.w),child: Image.asset(
image, image,
width: 166.w, width: 166.w,
height: 152.w, height: 152.w,
fit: BoxFit.fill, fit: BoxFit.fill,
),],))); ),)
,],)));
} }
} }

@ -1,3 +1,5 @@
import 'dart:async';
import 'package:bot_toast/bot_toast.dart'; import 'package:bot_toast/bot_toast.dart';
import 'package:flustars/flustars.dart'; import 'package:flustars/flustars.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -49,13 +51,15 @@ class _UserPageState extends State<UserPage> {
void initState() { void initState() {
super.initState(); super.initState();
if ( UserTool.userProvider.isLogin) { if ( UserTool.userProvider.isLogin) {
if (UserTool.userProvider.userInfo.end<=DateTime.now().millisecondsSinceEpoch ) { Timer.periodic(Duration(seconds: 1), (timer) {
if (UserTool.userProvider.userInfo.isVip==1 && UserTool.userProvider.userInfo.end>=DateTime.now().millisecondsSinceEpoch ) {
isVip = false; isVip = false;
vle =false; vle =false;
} else { } else {
vle =true; vle =true;
isVip = true; isVip = true;
} }
});
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{ }else{
vle = false; vle = false;
@ -295,7 +299,7 @@ class _UserPageState extends State<UserPage> {
// await prefs.setBool("kg", value); // await prefs.setBool("kg", value);
// print("这是数据${prefs.getBool("kg")}"); // print("这是数据${prefs.getBool("kg")}");
setState(() { setState(() {
if(isVip){ if(!isVip){
vle=value; vle=value;
// prefs.setBool("kg", vle); // prefs.setBool("kg", vle);

Loading…
Cancel
Save