mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
fix: 安卓端编译多个包时,buildNumber会额外拼上1、2、3之类的,会对更新判断造成影响
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
@@ -194,7 +196,12 @@ class AboutController extends GetxController {
|
||||
// 获取当前版本
|
||||
Future getCurrentApp() async {
|
||||
var currentInfo = await PackageInfo.fromPlatform();
|
||||
currentVersion.value = "v${currentInfo.version}+${currentInfo.buildNumber}";
|
||||
String buildNumber = currentInfo.buildNumber;
|
||||
//if is android
|
||||
if (Platform.isAndroid) {
|
||||
buildNumber = buildNumber.substring(0,buildNumber.length - 1);
|
||||
}
|
||||
currentVersion.value = "v${currentInfo.version}+$buildNumber";
|
||||
}
|
||||
|
||||
// 获取远程版本
|
||||
|
||||
Reference in New Issue
Block a user