mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-19 14:53:44 +00:00
feat: new ui (#1455)
This commit is contained in:
742 files changed
+59951
-5934
No files matched your search
@@ -2,6 +2,15 @@ import 'package:package_info_plus/package_info_plus.dart';
|
||||
|
||||
late PackageInfo packageInfo;
|
||||
|
||||
String get appVersion => normalizeAppVersion(packageInfo.version);
|
||||
|
||||
String normalizeAppVersion(String platformVersion) {
|
||||
final version = platformVersion.trim();
|
||||
final parts = version.split('.');
|
||||
if (parts.length != 4 || parts.any((part) => int.tryParse(part) == null)) return version;
|
||||
return '${parts[0]}.${parts[1]}.${parts[2]}-beta.${parts[3]}';
|
||||
}
|
||||
|
||||
Future<void> initPackageInfo() async {
|
||||
packageInfo = await PackageInfo.fromPlatform();
|
||||
}
|
||||
Reference in new issue
Block a user