diff --git a/lib/src/stores/settings/settings_store.dart b/lib/src/stores/settings/settings_store.dart index b9a78d24f..57136d06f 100644 --- a/lib/src/stores/settings/settings_store.dart +++ b/lib/src/stores/settings/settings_store.dart @@ -12,6 +12,7 @@ import 'package:cake_wallet/src/stores/action_list/action_list_display_mode.dart import 'package:cake_wallet/src/screens/settings/items/item_headers.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/src/domain/common/default_settings_migration.dart'; +import 'package:package_info/package_info.dart'; part 'settings_store.g.dart'; @@ -47,7 +48,10 @@ abstract class SettingsStoreBase with Store { serializeActionlistDisplayModes(actionlistDisplayMode)), fireImmediately: false); - currentVersion = _sharedPreferences.getInt('current_default_settings_migration_version'); + PackageInfo.fromPlatform().then((PackageInfo packageInfo) { + currentVersion = packageInfo.version; + }); + } static const currentNodeIdKey = 'current_node_id'; @@ -145,7 +149,7 @@ abstract class SettingsStoreBase with Store { SharedPreferences _sharedPreferences; Box _nodes; - int currentVersion; + String currentVersion; @action Future setAllowBiometricalAuthentication( @@ -268,7 +272,7 @@ abstract class SettingsStoreBase with Store { ItemHeaders.support: S.current.settings_support, ItemHeaders.termsAndConditions: S.current.settings_terms_and_conditions, ItemHeaders.faq: S.current.faq, - ItemHeaders.version: 'Version 1.0.$currentVersion' + ItemHeaders.version: 'Version $currentVersion' }); } diff --git a/pubspec.lock b/pubspec.lock index 72b66ac7a..ab6b8a29d 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -476,6 +476,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.1.0" + package_info: + dependency: "direct main" + description: + name: package_info + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.0+13" package_resolver: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index eccfe4fce..318057f0c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,7 +11,7 @@ description: Cake Wallet. # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.0.0+2 +version: 1.0.3+1 environment: sdk: ">=2.2.2 <3.0.0" @@ -46,6 +46,7 @@ dependencies: hive: ^1.2.0 hive_flutter: ^0.2.1 local_auth: ^0.6.1 + package_info: ^0.4.0+13 # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons.