CWA-168 | added app version to settings page (added currentVersion to settings store and item to item_headers)

This commit is contained in:
Oleksandr Sobol 2020-01-28 20:43:57 +02:00
parent 13618c6939
commit 50d857f23a
3 changed files with 12 additions and 2 deletions

View file

@ -14,4 +14,5 @@ class ItemHeaders {
static const support = 'Support';
static const termsAndConditions = 'Terms and conditions';
static const faq = 'FAQ';
static const version = 'Version';
}

View file

@ -279,7 +279,12 @@ class SettingsFormState extends State<SettingsForm> {
SettingsItem(
onTaped: () => Navigator.pushNamed(context, Routes.faq),
title: ItemHeaders.faq,
attribute: Attributes.arrow)
attribute: Attributes.arrow),
SettingsItem(
onTaped: () {},
title: ItemHeaders.version,
widget: null,
attribute: Attributes.widget)
]);
setState(() {});
}

View file

@ -46,6 +46,8 @@ abstract class SettingsStoreBase with Store {
(dynamic _) => _sharedPreferences.setInt(displayActionListModeKey,
serializeActionlistDisplayModes(actionlistDisplayMode)),
fireImmediately: false);
currentVersion = _sharedPreferences.getInt('current_default_settings_migration_version');
}
static const currentNodeIdKey = 'current_node_id';
@ -143,6 +145,7 @@ abstract class SettingsStoreBase with Store {
SharedPreferences _sharedPreferences;
Box<Node> _nodes;
int currentVersion;
@action
Future setAllowBiometricalAuthentication(
@ -264,7 +267,8 @@ abstract class SettingsStoreBase with Store {
ItemHeaders.darkMode: S.current.settings_dark_mode,
ItemHeaders.support: S.current.settings_support,
ItemHeaders.termsAndConditions: S.current.settings_terms_and_conditions,
ItemHeaders.faq: S.current.faq
ItemHeaders.faq: S.current.faq,
ItemHeaders.version: 'Version 1.0.$currentVersion'
});
}