更改图片位置

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

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

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

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

Loading…
Cancel
Save