Skip to content

Commit dbae150

Browse files
author
lyy
committed
feat: 更新版本号获取方式
1 parent 79521e0 commit dbae150

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.1.3
2+
3+
- [fix] 更新版本号获取方式
4+
15
## 1.1.2
26

37
- [feat] 新增版本检查

lib/utils/update_version.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ updateAppVersion() async {
1717
);
1818
String latestVersion = resp.data['tag_name'];
1919
latestVersion = latestVersion.replaceFirst('v', '');
20-
String currentVersion = '1.0.0';
20+
PackageInfo packageInfo = await PackageInfo.fromPlatform();
21+
String currentVersion = packageInfo.version;
2122
// 版本号对比
2223
if (isUpdateVersion(latestVersion, currentVersion)) {
2324
BotToast.showCustomLoading(

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: bbmusic
22
description: '哔哔音乐,听歌自由'
33
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
44

5-
version: 1.1.2+7
5+
version: 1.1.3+8
66

77
environment:
88
sdk: '>=3.3.1 <4.0.0'

0 commit comments

Comments
 (0)