Fix packageInfo for Desktop

This commit is contained in:
poka 2021-04-19 23:22:45 +02:00 committed by pokapow
parent 963e816d4a
commit 325fbb4400
1 changed files with 10 additions and 3 deletions

View File

@ -33,9 +33,16 @@ class HomeProvider with ChangeNotifier {
}
Future<String> getAppVersion() async {
PackageInfo packageInfo = await PackageInfo.fromPlatform();
String version = packageInfo.version;
String buildNumber = packageInfo.buildNumber;
String version;
String buildNumber;
if (Platform.isLinux) {
version = "undefined";
buildNumber = "undefined";
} else {
PackageInfo packageInfo = await PackageInfo.fromPlatform();
version = packageInfo.version;
buildNumber = packageInfo.buildNumber;
}
notifyListeners();
return version + '+' + buildNumber;