flutter: Windows: Can get packageInfo.version but not correct
This commit is contained in:
parent
75419ddbd6
commit
fd320117aa
|
@ -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})';
|
||||
});
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue