diff --git a/lib/generated/i18n.dart b/lib/generated/i18n.dart index 9e8e43bd9..c47b8cb4e 100644 --- a/lib/generated/i18n.dart +++ b/lib/generated/i18n.dart @@ -286,6 +286,7 @@ class S implements WidgetsLocalizations { String trade_id_not_found(String tradeId, String title) => "Trade ${tradeId} of ${title} not found."; String trade_is_powered_by(String provider) => "This trade is powered by ${provider}"; String transaction_details_copied(String title) => "${title} copied to Clipboard"; + String version(String currentVersion) => "Version ${currentVersion}"; String wallet_list_failed_to_load(String wallet_name, String error) => "Failed to load ${wallet_name} wallet. ${error}"; String wallet_list_failed_to_remove(String wallet_name, String error) => "Failed to remove ${wallet_name} wallet. ${error}"; String wallet_list_loading_wallet(String wallet_name) => "Loading ${wallet_name} wallet"; @@ -797,6 +798,8 @@ class $de extends S { @override String wallet_list_loading_wallet(String wallet_name) => "Wird geladen ${wallet_name} Wallet"; @override + String version(String currentVersion) => "Ausführung ${currentVersion}"; + @override String router_no_route(String name) => "Keine Route definiert für ${name}"; @override String trade_id_not_found(String tradeId, String title) => "Handel ${tradeId} von ${title} nicht gefunden."; @@ -1343,6 +1346,8 @@ class $hi extends S { @override String wallet_list_loading_wallet(String wallet_name) => "लोड हो रहा है ${wallet_name} बटुआ"; @override + String version(String currentVersion) => "संस्करण ${currentVersion}"; + @override String router_no_route(String name) => "के लिए कोई मार्ग निर्धारित नहीं है ${name}"; @override String trade_id_not_found(String tradeId, String title) => "व्यापार ${tradeId} of ${title} नहीं मिला."; @@ -1889,6 +1894,8 @@ class $ru extends S { @override String wallet_list_loading_wallet(String wallet_name) => "Загрузка ${wallet_name} кошелька"; @override + String version(String currentVersion) => "Версия ${currentVersion}"; + @override String router_no_route(String name) => "Экран не найден ${name}"; @override String trade_id_not_found(String tradeId, String title) => "Сделка ${tradeId} ${title} не найдена."; @@ -2435,6 +2442,8 @@ class $ko extends S { @override String wallet_list_loading_wallet(String wallet_name) => "로딩 ${wallet_name} 지갑"; @override + String version(String currentVersion) => "버전 ${currentVersion}"; + @override String router_no_route(String name) => "에 정의 된 경로가 없습니다 ${name}"; @override String trade_id_not_found(String tradeId, String title) => "무역 ${tradeId} 의 ${title} 찾을 수 없습니다."; @@ -2981,6 +2990,8 @@ class $pt extends S { @override String wallet_list_loading_wallet(String wallet_name) => "Abrindo a carteira ${wallet_name}"; @override + String version(String currentVersion) => "Versão ${currentVersion}"; + @override String router_no_route(String name) => "Nenhuma rota definida para ${name}"; @override String trade_id_not_found(String tradeId, String title) => "A troca ${tradeId} de ${title} não foi encontrada."; @@ -3527,6 +3538,8 @@ class $ja extends S { @override String wallet_list_loading_wallet(String wallet_name) => "読み込み中 ${wallet_name} 財布"; @override + String version(String currentVersion) => "バージョン ${currentVersion}"; + @override String router_no_route(String name) => "ルートが定義されていません ${name}"; @override String trade_id_not_found(String tradeId, String title) => "トレード ${tradeId} of ${title} 見つかりません"; @@ -4077,6 +4090,8 @@ class $pl extends S { @override String wallet_list_loading_wallet(String wallet_name) => "Ładuję ${wallet_name} portfel"; @override + String version(String currentVersion) => "Wersja ${currentVersion}"; + @override String router_no_route(String name) => "Brak zdefiniowanej trasy dla ${name}"; @override String trade_id_not_found(String tradeId, String title) => "Handel ${tradeId} of ${title} nie znaleziono."; @@ -4623,6 +4638,8 @@ class $es extends S { @override String wallet_list_loading_wallet(String wallet_name) => "Billetera ${wallet_name} de carga"; @override + String version(String currentVersion) => "Versión ${currentVersion}"; + @override String router_no_route(String name) => "No hay ruta definida para ${name}"; @override String trade_id_not_found(String tradeId, String title) => "Comercio ${tradeId} de ${title} no encontrado."; @@ -5169,6 +5186,8 @@ class $nl extends S { @override String wallet_list_loading_wallet(String wallet_name) => "Bezig met laden ${wallet_name} portemonnee"; @override + String version(String currentVersion) => "Versie ${currentVersion}"; + @override String router_no_route(String name) => "Geen route gedefinieerd voor ${name}"; @override String trade_id_not_found(String tradeId, String title) => "Handel ${tradeId} van ${title} niet gevonden."; @@ -5715,6 +5734,8 @@ class $zh extends S { @override String wallet_list_loading_wallet(String wallet_name) => "载入中 ${wallet_name} 钱包"; @override + String version(String currentVersion) => "版 ${currentVersion}"; + @override String router_no_route(String name) => "未定义路线 ${name}"; @override String trade_id_not_found(String tradeId, String title) => "贸易方式 ${tradeId} 的 ${title} 未找到."; diff --git a/lib/src/screens/dashboard/dashboard_page.dart b/lib/src/screens/dashboard/dashboard_page.dart index 23d5a3f8f..b7b3b229e 100644 --- a/lib/src/screens/dashboard/dashboard_page.dart +++ b/lib/src/screens/dashboard/dashboard_page.dart @@ -112,7 +112,7 @@ class DashboardPageBody extends StatefulWidget { } class DashboardPageBodyState extends State { - static final transactionDateFormat = DateFormat("MMM d, yyyy HH:mm"); + static final transactionDateFormat = DateFormat("MMMM d, yyyy HH:mm"); final _connectionStatusObserverKey = GlobalKey(); final _balanceObserverKey = GlobalKey(); @@ -587,7 +587,7 @@ class DashboardPageBodyState extends State { from: trade.from, to: trade.to, createdAtFormattedDate: - DateFormat("dd.MM.yyyy, H:m").format(trade.createdAt), + transactionDateFormat.format(trade.createdAt), formattedAmount: formattedAmount); } diff --git a/lib/src/screens/settings/items/item_headers.dart b/lib/src/screens/settings/items/item_headers.dart index 4ab7732c1..cc8a3b9aa 100644 --- a/lib/src/screens/settings/items/item_headers.dart +++ b/lib/src/screens/settings/items/item_headers.dart @@ -14,4 +14,5 @@ class ItemHeaders { static const support = 'Support'; static const termsAndConditions = 'Terms and conditions'; static const faq = 'FAQ'; + static const version = 'Version'; } \ No newline at end of file diff --git a/lib/src/screens/settings/settings.dart b/lib/src/screens/settings/settings.dart index b2f53bfea..982d85f0b 100644 --- a/lib/src/screens/settings/settings.dart +++ b/lib/src/screens/settings/settings.dart @@ -351,9 +351,9 @@ class SettingsFormState extends State { final item = _items[index]; bool _isDrawDivider = true; - if (item.attribute == Attributes.header) { + if (item.attribute == Attributes.header || item == _items.last) { _isDrawDivider = false; - } else if (index < _items.length - 1) { + } else { if (_items[index + 1].attribute == Attributes.header) { _isDrawDivider = false; } @@ -381,9 +381,13 @@ class SettingsFormState extends State { ], ); }), - Container( - height: 20.0, - color: Theme.of(context).accentTextTheme.headline.backgroundColor, + ListTile( + contentPadding: EdgeInsets.only(left: 20.0), + title: Text( + settingsStore.itemHeaders[ItemHeaders.version], + style: TextStyle( + fontSize: 14.0, color: Palette.wildDarkBlue) + ), ) ], )); diff --git a/lib/src/stores/settings/settings_store.dart b/lib/src/stores/settings/settings_store.dart index ef6f11236..786d4083e 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'; @@ -46,6 +47,9 @@ abstract class SettingsStoreBase with Store { (dynamic _) => _sharedPreferences.setInt(displayActionListModeKey, serializeActionlistDisplayModes(actionlistDisplayMode)), fireImmediately: false); + + PackageInfo.fromPlatform().then((PackageInfo packageInfo) => currentVersion = packageInfo.version); + } static const currentNodeIdKey = 'current_node_id'; @@ -143,6 +147,7 @@ abstract class SettingsStoreBase with Store { SharedPreferences _sharedPreferences; Box _nodes; + String currentVersion; @action Future setAllowBiometricalAuthentication( @@ -264,7 +269,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: S.current.version(currentVersion) }); } diff --git a/pubspec.lock b/pubspec.lock index a8b5c8ba7..d4adb3dbb 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -469,6 +469,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 306c34298..e20521171 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -45,6 +45,7 @@ dependencies: path: ./cw_monero hive: ^1.2.0 hive_flutter: ^0.2.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. diff --git a/res/values/strings_de.arb b/res/values/strings_de.arb index eeb48b405..8dd44f7b6 100644 --- a/res/values/strings_de.arb +++ b/res/values/strings_de.arb @@ -336,5 +336,7 @@ "paste" : "Einfügen", "restore_from_seed_placeholder" : "Bitte geben Sie hier Ihren Code ein", "add_new_word" : "Neues Wort hinzufügen", - "incorrect_seed" : "Der eingegebene Text ist ungültig." + "incorrect_seed" : "Der eingegebene Text ist ungültig.", + + "version" : "Ausführung ${currentVersion}" } \ No newline at end of file diff --git a/res/values/strings_en.arb b/res/values/strings_en.arb index e107a4a9e..3e878bbc3 100644 --- a/res/values/strings_en.arb +++ b/res/values/strings_en.arb @@ -336,5 +336,7 @@ "paste" : "Paste", "restore_from_seed_placeholder" : "Please enter or paste your seed here", "add_new_word" : "Add new word", - "incorrect_seed" : "The text entered is not valid." + "incorrect_seed" : "The text entered is not valid.", + + "version" : "Version ${currentVersion}" } \ No newline at end of file diff --git a/res/values/strings_es.arb b/res/values/strings_es.arb index fa46ee111..3d8e9472d 100644 --- a/res/values/strings_es.arb +++ b/res/values/strings_es.arb @@ -336,5 +336,7 @@ "paste" : "Pegar", "restore_from_seed_placeholder" : "Ingrese o pegue su frase de código aquí", "add_new_word" : "Agregar palabra nueva", - "incorrect_seed" : "El texto ingresado no es válido." + "incorrect_seed" : "El texto ingresado no es válido.", + + "version" : "Versión ${currentVersion}" } \ No newline at end of file diff --git a/res/values/strings_hi.arb b/res/values/strings_hi.arb index b6343da7d..712bc9082 100644 --- a/res/values/strings_hi.arb +++ b/res/values/strings_hi.arb @@ -336,5 +336,7 @@ "paste" : "पेस्ट करें", "restore_from_seed_placeholder" : "कृपया अपना कोड वाक्यांश यहां दर्ज करें या पेस्ट करें", "add_new_word" : "नया शब्द जोड़ें", - "incorrect_seed" : "दर्ज किया गया पाठ मान्य नहीं है।" + "incorrect_seed" : "दर्ज किया गया पाठ मान्य नहीं है।", + + "version" : "संस्करण ${currentVersion}" } \ No newline at end of file diff --git a/res/values/strings_ja.arb b/res/values/strings_ja.arb index e40aaa2b1..0dd826a09 100644 --- a/res/values/strings_ja.arb +++ b/res/values/strings_ja.arb @@ -336,5 +336,7 @@ "paste" : "ペースト", "restore_from_seed_placeholder" : "ここにコードフレーズを入力または貼り付けてください", "add_new_word" : "新しい単語を追加", - "incorrect_seed" : "入力されたテキストは無効です。" + "incorrect_seed" : "入力されたテキストは無効です。", + + "version" : "バージョン ${currentVersion}" } \ No newline at end of file diff --git a/res/values/strings_ko.arb b/res/values/strings_ko.arb index 6c594ea13..1be04579d 100644 --- a/res/values/strings_ko.arb +++ b/res/values/strings_ko.arb @@ -336,5 +336,7 @@ "paste" : "풀", "restore_from_seed_placeholder" : "여기에 코드 문구를 입력하거나 붙여 넣으십시오.", "add_new_word" : "새로운 단어 추가", - "incorrect_seed" : "입력하신 텍스트가 유효하지 않습니다." + "incorrect_seed" : "입력하신 텍스트가 유효하지 않습니다.", + + "version" : "버전 ${currentVersion}" } \ No newline at end of file diff --git a/res/values/strings_nl.arb b/res/values/strings_nl.arb index 986ebfa8e..7690fd275 100644 --- a/res/values/strings_nl.arb +++ b/res/values/strings_nl.arb @@ -336,5 +336,7 @@ "paste" : "Plakken", "restore_from_seed_placeholder" : "Voer hier uw codefrase in of plak deze", "add_new_word" : "Nieuw woord toevoegen", - "incorrect_seed" : "De ingevoerde tekst is niet geldig." + "incorrect_seed" : "De ingevoerde tekst is niet geldig.", + + "version" : "Versie ${currentVersion}" } \ No newline at end of file diff --git a/res/values/strings_pl.arb b/res/values/strings_pl.arb index bcfcffe1b..fdbd6df3f 100644 --- a/res/values/strings_pl.arb +++ b/res/values/strings_pl.arb @@ -336,5 +336,7 @@ "paste" : "Pasta", "restore_from_seed_placeholder" : "Wpisz lub wklej tutaj swoją frazę kodową", "add_new_word" : "Dodaj nowe słowo", - "incorrect_seed" : "Wprowadzony tekst jest nieprawidłowy." + "incorrect_seed" : "Wprowadzony tekst jest nieprawidłowy.", + + "version" : "Wersja ${currentVersion}" } \ No newline at end of file diff --git a/res/values/strings_pt.arb b/res/values/strings_pt.arb index 8a6d6d4c8..366ec1e81 100644 --- a/res/values/strings_pt.arb +++ b/res/values/strings_pt.arb @@ -336,5 +336,7 @@ "paste" : "Colar", "restore_from_seed_placeholder" : "Digite ou cole sua frase de código aqui", "add_new_word" : "Adicionar nova palavra", - "incorrect_seed" : "O texto digitado não é válido." + "incorrect_seed" : "O texto digitado não é válido.", + + "version" : "Versão ${currentVersion}" } diff --git a/res/values/strings_ru.arb b/res/values/strings_ru.arb index 5ca7c9bcb..3e5ededb0 100644 --- a/res/values/strings_ru.arb +++ b/res/values/strings_ru.arb @@ -336,5 +336,7 @@ "paste" : "Вставить", "restore_from_seed_placeholder" : "Введите или вставте код фразу вашего кошелька", "add_new_word" : "Добавить новое слово", - "incorrect_seed" : "Введенный текст некорректный." + "incorrect_seed" : "Введенный текст некорректный.", + + "version" : "Версия ${currentVersion}" } \ No newline at end of file diff --git a/res/values/strings_zh.arb b/res/values/strings_zh.arb index 69c5e886f..451168f6b 100644 --- a/res/values/strings_zh.arb +++ b/res/values/strings_zh.arb @@ -336,5 +336,7 @@ "paste" : "糊", "restore_from_seed_placeholder" : "请在此处输入或粘贴您的代码短语", "add_new_word" : "添加新词", - "incorrect_seed" : "输入的文字无效。" + "incorrect_seed" : "输入的文字无效。", + + "version" : "版 ${currentVersion}" } \ No newline at end of file