更改提交

master
王亚玲 2 years ago
parent 3bb7c372f6
commit 741c103161

@ -19,7 +19,23 @@ if (flutterVersionCode == null) {
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}else{
//
def tem1=Integer.parseInt(flutterVersionName.substring(flutterVersionName.lastIndexof(".")+1,flutterVersionName.length()))
tem1++
//localPropertiesfluttervarsionName
def newVersionName=flutterVersionName.substring(0,flutterVersionName.lastIndexof(".")+1)+tem1
localProperties.setProperty("flutter.versionName",newVersionName)
flutterVersionName=newVersionName
//localproperyiesstring,local.properties
def newLocalProperties=localProperties.toString()
newLocalProperties =newLocalProperties.replace(",","\n")
newLocalProperties =newLocalProperties.replace("{","")
newLocalProperties =newLocalProperties.replace("}","")
localPropertiesFile.write(newLocalProperties)
}
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {

@ -209,8 +209,8 @@ class UserProvider extends ChangeNotifier {
for (int i = 0; i < numberList.length; i++) {
numList.add(numberList[i].phone);
}
await prefs.setStringList("specified", numList ?? []);
await prefs.setStringList("addressList", numbers ?? []);
await prefs.setStringList("specified", numList);
await prefs.setStringList("addressList", numbers);
service.invoke("stopService");
if (prefs.getBool('kg')!) {

@ -58,7 +58,7 @@ class _CallingIdleListState extends State<CallingIdleList>
Future<void> getSwitch() async {
final SharedPreferences prefs = await _prefs;
val = prefs.getBool(widget.name!)!;
val = prefs.getBool(widget.name!) ?? false;
print(val);
}
@ -180,7 +180,7 @@ class _CallingIdleListState extends State<CallingIdleList>
setState(() {
val = value;
prefs.remove(widget.name!);
prefs.setBool(widget.name!, val);
prefs.setBool(widget.name!, val );
});
service.invoke("stopService");
if (prefs.getBool('kg')!) {

@ -192,18 +192,18 @@ class _PhoneSetPageState extends State<PhoneSetPage> {
final service = FlutterBackgroundService();
return GestureDetector(
onTap: () async {
// final SharedPreferences prefs = await SharedPreferences.getInstance();
// select = index;
// await prefs.setInt("numIndex", index);
// service.invoke("stopService");
// if (prefs.getBool('kg')!) {
// Future.delayed(const Duration(seconds: 1), () async {
// service.startService();
// });
// }
//
// UserTool.userProvider.viewLoading();
// _refreshController.callRefresh();
final SharedPreferences prefs = await SharedPreferences.getInstance();
select = index;
await prefs.setInt("numIndex", index);
service.invoke("stopService");
if (prefs.getBool('kg') ?? false) {
Future.delayed(const Duration(seconds: 1), () async {
service.startService();
});
}
UserTool.userProvider.viewLoading();
_refreshController.callRefresh();
// print(_selectIndex);
setState(() {});
},
@ -228,17 +228,17 @@ class _PhoneSetPageState extends State<PhoneSetPage> {
height: 40.w,
child: Radio(
onChanged: (int? value) async{
final SharedPreferences prefs = await SharedPreferences.getInstance();
select = index;
await prefs.setInt("numIndex", index);
service.invoke("stopService");
if (prefs.getBool('kg')!) {
Future.delayed(const Duration(seconds: 1), () async {
service.startService();
});
}
UserTool.userProvider.viewLoading();
_refreshController.callRefresh();
// final SharedPreferences prefs = await SharedPreferences.getInstance();
// select = index;
// await prefs.setInt("numIndex", index);
// service.invoke("stopService");
// if (prefs.getBool('kg')!) {
// Future.delayed(const Duration(seconds: 1), () async {
// service.startService();
// });
// }
// UserTool.userProvider.viewLoading();
// _refreshController.callRefresh();
// select = index;
// print(_selectIndex);
setState(() {});

@ -75,6 +75,7 @@ class _UserCardPageState extends State<UserCardPage> {
}else{
var res= await UserInfoFunc.getAddVip(cardMi);
if(res){
// Navigator.pop(context,true);
Get.back();
}
// CloudToast.show("卡密兑换成功");

@ -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(

Loading…
Cancel
Save