flutter: Windows: Can get packageInfo.version but not correct

This commit is contained in:
Calcitem 2021-05-09 23:56:12 +08:00
parent 75419ddbd6
commit fd320117aa
2 changed files with 5 additions and 4 deletions

View File

@ -21,7 +21,7 @@ import 'dart:io';
import 'package:devicelocale/devicelocale.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:package_info/package_info.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:sanmill/generated/l10n.dart';
import 'package:sanmill/style/app_theme.dart';
import 'package:sanmill/widgets/settings_list_tile.dart';
@ -152,12 +152,13 @@ class _AboutPageState extends State<AboutPage> {
}
_loadVersionInfo() async {
final packageInfo = await PackageInfo.fromPlatform();
if (Platform.isWindows) {
setState(() {
_version = 'Unknown version';
_version = '${packageInfo.version}'; // TODO
});
} else {
final packageInfo = await PackageInfo.fromPlatform();
setState(() {
_version = '${packageInfo.version} (${packageInfo.buildNumber})';
});

View File

@ -14,7 +14,7 @@ dependencies:
cupertino_icons: ^1.0.2
soundpool: ^2.0.0-nullsafety.0
path_provider: ^2.0.1
package_info: ^2.0.0
package_info_plus: ^1.0.1
uuid: ^3.0.4
url_launcher: ^6.0.3
intl: 0.17.0