From 799f691610f1dd081a5157ba850ccf5f8439d3df Mon Sep 17 00:00:00 2001 From: Oleksandr Sobol Date: Fri, 18 Dec 2020 15:48:04 +0200 Subject: [PATCH 1/6] CAKE-218 | changed sync status text --- lib/generated/i18n.dart | 2 +- res/values/strings_en.arb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/generated/i18n.dart b/lib/generated/i18n.dart index fd0c0f70e..4d58f6eb1 100644 --- a/lib/generated/i18n.dart +++ b/lib/generated/i18n.dart @@ -255,7 +255,7 @@ class S implements WidgetsLocalizations { String get subaddresses => "Subaddresses"; String get sync_status_connected => "CONNECTED"; String get sync_status_connecting => "CONNECTING"; - String get sync_status_failed_connect => "FAILED CONNECT TO THE NODE"; + String get sync_status_failed_connect => "FAILED TO CONNECT TO THE NODE"; String get sync_status_not_connected => "NOT CONNECTED"; String get sync_status_starting_sync => "STARTING SYNC"; String get sync_status_syncronized => "SYNCHRONIZED"; diff --git a/res/values/strings_en.arb b/res/values/strings_en.arb index 8a1267236..919d8f811 100644 --- a/res/values/strings_en.arb +++ b/res/values/strings_en.arb @@ -342,7 +342,7 @@ "sync_status_syncronized" : "SYNCHRONIZED", "sync_status_not_connected" : "NOT CONNECTED", "sync_status_starting_sync" : "STARTING SYNC", - "sync_status_failed_connect" : "FAILED CONNECT TO THE NODE", + "sync_status_failed_connect" : "FAILED TO CONNECT TO THE NODE", "sync_status_connecting" : "CONNECTING", "sync_status_connected" : "CONNECTED", From b2a2c16feb298c993a85187f358cbb6f6358a783 Mon Sep 17 00:00:00 2001 From: Oleksandr Sobol Date: Fri, 18 Dec 2020 17:51:57 +0200 Subject: [PATCH 2/6] CAKE-218 | changed sync status text --- lib/generated/i18n.dart | 24 ++++++++++++------------ res/values/strings_de.arb | 2 +- res/values/strings_en.arb | 2 +- res/values/strings_es.arb | 2 +- res/values/strings_hi.arb | 2 +- res/values/strings_ja.arb | 2 +- res/values/strings_ko.arb | 2 +- res/values/strings_nl.arb | 2 +- res/values/strings_pl.arb | 2 +- res/values/strings_pt.arb | 2 +- res/values/strings_ru.arb | 2 +- res/values/strings_uk.arb | 2 +- res/values/strings_zh.arb | 2 +- 13 files changed, 24 insertions(+), 24 deletions(-) diff --git a/lib/generated/i18n.dart b/lib/generated/i18n.dart index 4d58f6eb1..704b16bbe 100644 --- a/lib/generated/i18n.dart +++ b/lib/generated/i18n.dart @@ -255,7 +255,7 @@ class S implements WidgetsLocalizations { String get subaddresses => "Subaddresses"; String get sync_status_connected => "CONNECTED"; String get sync_status_connecting => "CONNECTING"; - String get sync_status_failed_connect => "FAILED TO CONNECT TO THE NODE"; + String get sync_status_failed_connect => "DISCONNECTED"; String get sync_status_not_connected => "NOT CONNECTED"; String get sync_status_starting_sync => "STARTING SYNC"; String get sync_status_syncronized => "SYNCHRONIZED"; @@ -594,7 +594,7 @@ class $de extends S { @override String get exchange => "Austausch"; @override - String get sync_status_failed_connect => "Verbindung zum Knoten fehlgeschlagen"; + String get sync_status_failed_connect => "GETRENNT"; @override String get send_estimated_fee => "Geschätzte Gebühr:"; @override @@ -1286,7 +1286,7 @@ class $hi extends S { @override String get exchange => "अदला बदली"; @override - String get sync_status_failed_connect => "फेल हुआ कनेक्ट नोड"; + String get sync_status_failed_connect => "डिस्कनेक्ट किया गया"; @override String get send_estimated_fee => "अनुमानित शुल्क:"; @override @@ -1978,7 +1978,7 @@ class $ru extends S { @override String get exchange => "Обмен"; @override - String get sync_status_failed_connect => "ОШИБКА ПОДКЛЮЧЕНИЯ К НОДЕ"; + String get sync_status_failed_connect => "ОТКЛЮЧЕНО"; @override String get send_estimated_fee => "Предполагаемая комиссия:"; @override @@ -2670,7 +2670,7 @@ class $ko extends S { @override String get exchange => "교환"; @override - String get sync_status_failed_connect => "노드에 연결하지 못했습니다"; + String get sync_status_failed_connect => "연결 해제"; @override String get send_estimated_fee => "예상 수수료:"; @override @@ -3362,7 +3362,7 @@ class $pt extends S { @override String get exchange => "Trocar"; @override - String get sync_status_failed_connect => "Erro ao conectar com o nó"; + String get sync_status_failed_connect => "DESCONECTADO"; @override String get send_estimated_fee => "Taxa estimada:"; @override @@ -4054,7 +4054,7 @@ class $uk extends S { @override String get exchange => "Обмін"; @override - String get sync_status_failed_connect => "ПОМИЛКА ПІДКЛЮЧЕННЯ ДО ВУЗЛУ"; + String get sync_status_failed_connect => "ВІДКЛЮЧЕНО"; @override String get send_estimated_fee => "Ймовірна комісія:"; @override @@ -4746,7 +4746,7 @@ class $ja extends S { @override String get exchange => "交換する"; @override - String get sync_status_failed_connect => "ノードへの接続に失敗しました"; + String get sync_status_failed_connect => "切断されました"; @override String get send_estimated_fee => "見積手数料:"; @override @@ -5442,7 +5442,7 @@ class $pl extends S { @override String get exchange => "Wymieniać się"; @override - String get sync_status_failed_connect => "NIE MOŻNA PODŁĄCZYĆ DO WĘZŁA"; + String get sync_status_failed_connect => "NIEPOWIĄZANY"; @override String get send_estimated_fee => "Szacowana opłata:"; @override @@ -6134,7 +6134,7 @@ class $es extends S { @override String get exchange => "Intercambiar"; @override - String get sync_status_failed_connect => "CONEXIÓN FALLIDA AL NODO"; + String get sync_status_failed_connect => "DESCONECTADO"; @override String get send_estimated_fee => "Tarifa estimada:"; @override @@ -6826,7 +6826,7 @@ class $nl extends S { @override String get exchange => "Uitwisseling"; @override - String get sync_status_failed_connect => "MISLUKT VERBINDING MET DE NODE"; + String get sync_status_failed_connect => "LOSGEKOPPELD"; @override String get send_estimated_fee => "Geschatte vergoeding:"; @override @@ -7518,7 +7518,7 @@ class $zh extends S { @override String get exchange => "交换"; @override - String get sync_status_failed_connect => "无法连接到节点"; + String get sync_status_failed_connect => "斷線"; @override String get send_estimated_fee => "预估费用:"; @override diff --git a/res/values/strings_de.arb b/res/values/strings_de.arb index eb0a6080b..794324927 100644 --- a/res/values/strings_de.arb +++ b/res/values/strings_de.arb @@ -342,7 +342,7 @@ "sync_status_syncronized" : "SYNCHRONISIERT", "sync_status_not_connected" : "NICHT VERBUNDEN", "sync_status_starting_sync" : "STARTEN DER SYNCHRONISIERUNG", - "sync_status_failed_connect" : "Verbindung zum Knoten fehlgeschlagen", + "sync_status_failed_connect" : "GETRENNT", "sync_status_connecting" : "ANSCHLUSS", "sync_status_connected" : "IN VERBINDUNG GEBRACHT", diff --git a/res/values/strings_en.arb b/res/values/strings_en.arb index 919d8f811..04f0011b5 100644 --- a/res/values/strings_en.arb +++ b/res/values/strings_en.arb @@ -342,7 +342,7 @@ "sync_status_syncronized" : "SYNCHRONIZED", "sync_status_not_connected" : "NOT CONNECTED", "sync_status_starting_sync" : "STARTING SYNC", - "sync_status_failed_connect" : "FAILED TO CONNECT TO THE NODE", + "sync_status_failed_connect" : "DISCONNECTED", "sync_status_connecting" : "CONNECTING", "sync_status_connected" : "CONNECTED", diff --git a/res/values/strings_es.arb b/res/values/strings_es.arb index 00acdcb0c..e93e0c839 100644 --- a/res/values/strings_es.arb +++ b/res/values/strings_es.arb @@ -342,7 +342,7 @@ "sync_status_syncronized" : "SINCRONIZADO", "sync_status_not_connected" : "NO CONECTADO", "sync_status_starting_sync" : "EMPEZANDO A SINCRONIZAR", - "sync_status_failed_connect" : "CONEXIÓN FALLIDA AL NODO", + "sync_status_failed_connect" : "DESCONECTADO", "sync_status_connecting" : "CONECTANDO", "sync_status_connected" : "CONECTADO", diff --git a/res/values/strings_hi.arb b/res/values/strings_hi.arb index 9a9545c5d..6607db7f6 100644 --- a/res/values/strings_hi.arb +++ b/res/values/strings_hi.arb @@ -342,7 +342,7 @@ "sync_status_syncronized" : "सिंक्रनाइज़", "sync_status_not_connected" : "जुड़े नहीं हैं", "sync_status_starting_sync" : "सिताज़ा करना", - "sync_status_failed_connect" : "फेल हुआ कनेक्ट नोड", + "sync_status_failed_connect" : "डिस्कनेक्ट किया गया", "sync_status_connecting" : "कनेक्ट", "sync_status_connected" : "जुड़े हुए", diff --git a/res/values/strings_ja.arb b/res/values/strings_ja.arb index cb4b63414..30f0a8c1b 100644 --- a/res/values/strings_ja.arb +++ b/res/values/strings_ja.arb @@ -342,7 +342,7 @@ "sync_status_syncronized" : "同期された", "sync_status_not_connected" : "接続されていません", "sync_status_starting_sync" : "同期の開始", - "sync_status_failed_connect" : "ノードへの接続に失敗しました", + "sync_status_failed_connect" : "切断されました", "sync_status_connecting" : "接続中", "sync_status_connected" : "接続済み", diff --git a/res/values/strings_ko.arb b/res/values/strings_ko.arb index c14898fd9..844e737d9 100644 --- a/res/values/strings_ko.arb +++ b/res/values/strings_ko.arb @@ -342,7 +342,7 @@ "sync_status_syncronized" : "동기화", "sync_status_not_connected" : "연결되지 않은", "sync_status_starting_sync" : "동기화 시작", - "sync_status_failed_connect" : "노드에 연결하지 못했습니다", + "sync_status_failed_connect" : "연결 해제", "sync_status_connecting" : "연결 중", "sync_status_connected" : "연결됨", diff --git a/res/values/strings_nl.arb b/res/values/strings_nl.arb index e5093a406..6bfa5847f 100644 --- a/res/values/strings_nl.arb +++ b/res/values/strings_nl.arb @@ -342,7 +342,7 @@ "sync_status_syncronized" : "SYNCHRONIZED", "sync_status_not_connected" : "NIET VERBONDEN", "sync_status_starting_sync" : "BEGINNEN MET SYNCHRONISEREN", - "sync_status_failed_connect" : "MISLUKT VERBINDING MET DE NODE", + "sync_status_failed_connect" : "LOSGEKOPPELD", "sync_status_connecting" : "AANSLUITING", "sync_status_connected" : "VERBONDEN", diff --git a/res/values/strings_pl.arb b/res/values/strings_pl.arb index e6b098360..e44089cba 100644 --- a/res/values/strings_pl.arb +++ b/res/values/strings_pl.arb @@ -342,7 +342,7 @@ "sync_status_syncronized" : "SYNCHRONIZOWANY", "sync_status_not_connected" : "NIE POŁĄCZONY", "sync_status_starting_sync" : "ROZPOCZĘCIE SYNCHRONIZACJI", - "sync_status_failed_connect" : "NIE MOŻNA PODŁĄCZYĆ DO WĘZŁA", + "sync_status_failed_connect" : "NIEPOWIĄZANY", "sync_status_connecting" : "ZŁĄCZONY", "sync_status_connected" : "POŁĄCZONY", diff --git a/res/values/strings_pt.arb b/res/values/strings_pt.arb index e82032d7b..dbe341b62 100644 --- a/res/values/strings_pt.arb +++ b/res/values/strings_pt.arb @@ -342,7 +342,7 @@ "sync_status_syncronized" : "SINCRONIZADO", "sync_status_not_connected" : "DESCONECTADO", "sync_status_starting_sync" : "INICIANDO SINCRONIZAÇÃO", - "sync_status_failed_connect" : "Erro ao conectar com o nó", + "sync_status_failed_connect" : "DESCONECTADO", "sync_status_connecting" : "CONECTANDO", "sync_status_connected" : "CONECTADO", diff --git a/res/values/strings_ru.arb b/res/values/strings_ru.arb index b78b86ff1..e9d04941b 100644 --- a/res/values/strings_ru.arb +++ b/res/values/strings_ru.arb @@ -342,7 +342,7 @@ "sync_status_syncronized" : "СИНХРОНИЗИРОВАН", "sync_status_not_connected" : "НЕ ПОДКЛЮЧЁН", "sync_status_starting_sync" : "НАЧАЛО СИНХРОНИЗАЦИИ", - "sync_status_failed_connect" : "ОШИБКА ПОДКЛЮЧЕНИЯ К НОДЕ", + "sync_status_failed_connect" : "ОТКЛЮЧЕНО", "sync_status_connecting" : "ПОДКЛЮЧЕНИЕ", "sync_status_connected" : "ПОДКЛЮЧЕНО", diff --git a/res/values/strings_uk.arb b/res/values/strings_uk.arb index be77cd293..0305d0336 100644 --- a/res/values/strings_uk.arb +++ b/res/values/strings_uk.arb @@ -342,7 +342,7 @@ "sync_status_syncronized" : "СИНХРОНІЗОВАНИЙ", "sync_status_not_connected" : "НЕ ПІДКЛЮЧЕННИЙ", "sync_status_starting_sync" : "ПОЧАТОК СИНХРОНІЗАЦІЇ", - "sync_status_failed_connect" : "ПОМИЛКА ПІДКЛЮЧЕННЯ ДО ВУЗЛУ", + "sync_status_failed_connect" : "ВІДКЛЮЧЕНО", "sync_status_connecting" : "ПІДКЛЮЧЕННЯ", "sync_status_connected" : "ПІДКЛЮЧЕНО", diff --git a/res/values/strings_zh.arb b/res/values/strings_zh.arb index ee633aae8..d53701faa 100644 --- a/res/values/strings_zh.arb +++ b/res/values/strings_zh.arb @@ -342,7 +342,7 @@ "sync_status_syncronized" : "已同步", "sync_status_not_connected" : "未连接", "sync_status_starting_sync" : "开始同步", - "sync_status_failed_connect" : "无法连接到节点", + "sync_status_failed_connect" : "斷線", "sync_status_connecting" : "连接中", "sync_status_connected" : "连接的", From b59d6336657689b7d4b7be6c531fc5416ce024b0 Mon Sep 17 00:00:00 2001 From: OleksandrSobol Date: Fri, 18 Dec 2020 20:02:08 +0200 Subject: [PATCH 3/6] CAKE-217 | reduced space between rows in the trade_row.dart and transaction_raw.dart --- .../screens/dashboard/widgets/trade_row.dart | 85 ++++++------ .../dashboard/widgets/transaction_raw.dart | 126 +++++++++--------- 2 files changed, 103 insertions(+), 108 deletions(-) diff --git a/lib/src/screens/dashboard/widgets/trade_row.dart b/lib/src/screens/dashboard/widgets/trade_row.dart index 82bf2fc3e..3860b5010 100644 --- a/lib/src/screens/dashboard/widgets/trade_row.dart +++ b/lib/src/screens/dashboard/widgets/trade_row.dart @@ -25,54 +25,51 @@ class TradeRow extends StatelessWidget { return InkWell( onTap: onTap, child: Container( - height: 52, + padding: EdgeInsets.fromLTRB(24, 8, 24, 8), color: Colors.transparent, - padding: EdgeInsets.only(left: 24, right: 24), child: Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - _getPoweredImage(provider), - Expanded( - child: Padding( - padding: const EdgeInsets.only(left: 12), - child: Container( - height: 46, - child: Column( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + _getPoweredImage(provider), + SizedBox(width: 12), + Expanded( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, - mainAxisSize: MainAxisSize.max, children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text('${from.toString()} → ${to.toString()}', - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight.w500, - color: Colors.white - )), - formattedAmount != null - ? Text(formattedAmount + ' ' + amountCrypto, - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight.w500, - color: Colors.white - )) - : Container() - ]), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text(createdAtFormattedDate, - style: TextStyle( - fontSize: 14, - color: Theme.of(context).textTheme - .overline.backgroundColor)) - ]), - ], - ), - ), - )) - ]), + Text('${from.toString()} → ${to.toString()}', + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w500, + color: Colors.white + )), + formattedAmount != null + ? Text(formattedAmount + ' ' + amountCrypto, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w500, + color: Colors.white + )) + : Container() + ]), + SizedBox(height: 5), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text(createdAtFormattedDate, + style: TextStyle( + fontSize: 14, + color: Theme.of(context).textTheme + .overline.backgroundColor)) + ]) + ], + ) + ) + ], + ), )); } diff --git a/lib/src/screens/dashboard/widgets/transaction_raw.dart b/lib/src/screens/dashboard/widgets/transaction_raw.dart index 67e13ce43..914579897 100644 --- a/lib/src/screens/dashboard/widgets/transaction_raw.dart +++ b/lib/src/screens/dashboard/widgets/transaction_raw.dart @@ -23,73 +23,71 @@ class TransactionRow extends StatelessWidget { return InkWell( onTap: onTap, child: Container( - height: 62, + padding: EdgeInsets.fromLTRB(24, 8, 24, 8), color: Colors.transparent, - padding: EdgeInsets.only(left: 24, right: 24), child: Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - height: 36, - width: 36, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: Theme.of(context).textTheme.overline.decorationColor - ), - child: Image.asset( - direction == TransactionDirection.incoming - ? 'assets/images/down_arrow.png' - : 'assets/images/up_arrow.png'), + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + height: 36, + width: 36, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Theme.of(context).textTheme.overline.decorationColor ), - Expanded( - child: Container( - padding: const EdgeInsets.only(left: 12), - height: 56, - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - mainAxisSize: MainAxisSize.max, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - (direction == TransactionDirection.incoming - ? S.of(context).received - : S.of(context).sent) + - (isPending ? S.of(context).pending : ''), - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight.w500, - color: Colors.white)), - Text(formattedAmount, - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight.w500, - color: Colors.white)) - ]), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text(formattedDate, - style: TextStyle( - fontSize: 14, - color: Theme.of(context) - .textTheme - .overline - .backgroundColor)), - Text(formattedFiatAmount, - style: TextStyle( - fontSize: 14, - color: Theme.of(context) - .textTheme - .overline - .backgroundColor)) - ]), - ], - ), - ), - ) - ]), + child: Image.asset( + direction == TransactionDirection.incoming + ? 'assets/images/down_arrow.png' + : 'assets/images/up_arrow.png'), + ), + SizedBox(width: 12), + Expanded( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + (direction == TransactionDirection.incoming + ? S.of(context).received + : S.of(context).sent) + + (isPending ? S.of(context).pending : ''), + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w500, + color: Colors.white)), + Text(formattedAmount, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w500, + color: Colors.white)) + ]), + SizedBox(height: 5), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text(formattedDate, + style: TextStyle( + fontSize: 14, + color: Theme.of(context) + .textTheme + .overline + .backgroundColor)), + Text(formattedFiatAmount, + style: TextStyle( + fontSize: 14, + color: Theme.of(context) + .textTheme + .overline + .backgroundColor)) + ]) + ], + ) + ) + ], + ), )); } } From dcb892b24c89311b9a73f4eea092ba1e6799c55a Mon Sep 17 00:00:00 2001 From: OleksandrSobol Date: Fri, 18 Dec 2020 21:24:05 +0200 Subject: [PATCH 4/6] CAKE-217 | merged 4.1.0 branch into current and resolved problems --- lib/src/screens/dashboard/widgets/trade_row.dart | 6 ++++-- lib/src/screens/dashboard/widgets/transaction_raw.dart | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/src/screens/dashboard/widgets/trade_row.dart b/lib/src/screens/dashboard/widgets/trade_row.dart index 3860b5010..449c4d016 100644 --- a/lib/src/screens/dashboard/widgets/trade_row.dart +++ b/lib/src/screens/dashboard/widgets/trade_row.dart @@ -44,14 +44,16 @@ class TradeRow extends StatelessWidget { style: TextStyle( fontSize: 16, fontWeight: FontWeight.w500, - color: Colors.white + color: Theme.of(context).accentTextTheme. + display3.backgroundColor )), formattedAmount != null ? Text(formattedAmount + ' ' + amountCrypto, style: TextStyle( fontSize: 16, fontWeight: FontWeight.w500, - color: Colors.white + color: Theme.of(context).accentTextTheme. + display3.backgroundColor )) : Container() ]), diff --git a/lib/src/screens/dashboard/widgets/transaction_raw.dart b/lib/src/screens/dashboard/widgets/transaction_raw.dart index 914579897..23a3eccec 100644 --- a/lib/src/screens/dashboard/widgets/transaction_raw.dart +++ b/lib/src/screens/dashboard/widgets/transaction_raw.dart @@ -57,12 +57,14 @@ class TransactionRow extends StatelessWidget { style: TextStyle( fontSize: 16, fontWeight: FontWeight.w500, - color: Colors.white)), + color: Theme.of(context).accentTextTheme. + display3.backgroundColor)), Text(formattedAmount, style: TextStyle( fontSize: 16, fontWeight: FontWeight.w500, - color: Colors.white)) + color: Theme.of(context).accentTextTheme. + display3.backgroundColor)) ]), SizedBox(height: 5), Row( From bd2bab997fec1704db84c39819716d2a450f8607 Mon Sep 17 00:00:00 2001 From: M Date: Fri, 18 Dec 2020 21:30:43 +0200 Subject: [PATCH 5/6] Added backsupport for old saved themes --- lib/entities/preferences_key.dart | 1 + lib/store/settings_store.dart | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/entities/preferences_key.dart b/lib/entities/preferences_key.dart index f9bf224f8..c2d6427c9 100644 --- a/lib/entities/preferences_key.dart +++ b/lib/entities/preferences_key.dart @@ -10,6 +10,7 @@ class PreferencesKey { static const allowBiometricalAuthenticationKey = 'allow_biometrical_authentication'; static const currentTheme = 'current_theme'; + static const isDarkThemeLegacy = 'dark_theme'; static const displayActionListModeKey = 'display_list_mode'; static const currentPinLength = 'current_pin_length'; static const currentLanguageCode = 'language_code'; diff --git a/lib/store/settings_store.dart b/lib/store/settings_store.dart index db9efd8d8..30cf4f238 100644 --- a/lib/store/settings_store.dart +++ b/lib/store/settings_store.dart @@ -66,8 +66,8 @@ abstract class SettingsStoreBase with Store { reaction( (_) => currentTheme, - (ThemeBase theme) => sharedPreferences.setInt( - PreferencesKey.currentTheme, theme.raw)); + (ThemeBase theme) => + sharedPreferences.setInt(PreferencesKey.currentTheme, theme.raw)); reaction( (_) => allowBiometricalAuthentication, @@ -152,8 +152,14 @@ abstract class SettingsStoreBase with Store { final allowBiometricalAuthentication = sharedPreferences .getBool(PreferencesKey.allowBiometricalAuthenticationKey) ?? false; + final legacyTheme = + sharedPreferences.getBool(PreferencesKey.isDarkThemeLegacy) + ? ThemeType.dark.index + : ThemeType.bright.index; final savedTheme = ThemeList.deserialize( - raw: sharedPreferences.getInt(PreferencesKey.currentTheme) ?? 0); + raw: sharedPreferences.getInt(PreferencesKey.currentTheme) ?? + legacyTheme ?? + 0); final actionListDisplayMode = ObservableList(); actionListDisplayMode.addAll(deserializeActionlistDisplayModes( sharedPreferences.getInt(PreferencesKey.displayActionListModeKey) ?? From 7f2b1093817a720b3edb449f6957a93fa40e2ab6 Mon Sep 17 00:00:00 2001 From: M Date: Mon, 21 Dec 2020 22:20:46 +0200 Subject: [PATCH 6/6] Fixed balance dispaying. Changed updating of balance after sending. Changed text for pre seed screen for btc wallet type. --- lib/bitcoin/bitcoin_balance.dart | 3 ++- lib/bitcoin/bitcoin_wallet.dart | 5 +++- lib/di.dart | 3 ++- lib/generated/i18n.dart | 24 +++++++++---------- lib/router.dart | 17 +++++++------ .../dashboard/widgets/balance_page.dart | 5 ++-- lib/src/screens/seed/pre_seed_page.dart | 16 ++++++++++--- 7 files changed, 46 insertions(+), 27 deletions(-) diff --git a/lib/bitcoin/bitcoin_balance.dart b/lib/bitcoin/bitcoin_balance.dart index 1f5a70b72..3cc66bfe8 100644 --- a/lib/bitcoin/bitcoin_balance.dart +++ b/lib/bitcoin/bitcoin_balance.dart @@ -27,7 +27,8 @@ class BitcoinBalance extends Balance { final int confirmed; final int unconfirmed; - int get total => confirmed + unconfirmed; + int get total => + confirmed + (unconfirmed < 0 ? unconfirmed * -1 : unconfirmed); int get availableBalance => confirmed + (unconfirmed < 0 ? unconfirmed : 0); diff --git a/lib/bitcoin/bitcoin_wallet.dart b/lib/bitcoin/bitcoin_wallet.dart index eaf5d2864..052440f1e 100644 --- a/lib/bitcoin/bitcoin_wallet.dart +++ b/lib/bitcoin/bitcoin_wallet.dart @@ -319,7 +319,10 @@ abstract class BitcoinWalletBase extends WalletBase with Store { return PendingBitcoinTransaction(txb.build(), eclient: eclient, amount: amount, fee: fee) - ..addListener((transaction) => transactionHistory.addOne(transaction)); + ..addListener((transaction) async { + transactionHistory.addOne(transaction); + await _updateBalance(); + }); } String toJSON() => json.encode({ diff --git a/lib/di.dart b/lib/di.dart index 12828300d..0a6646e5d 100644 --- a/lib/di.dart +++ b/lib/di.dart @@ -426,5 +426,6 @@ Future setup( (para1, param2) => NewWalletTypePage(getIt.get(), onTypeSelected: para1, isNewWallet: param2)); - getIt.registerFactory(() => PreSeedPage()); + getIt.registerFactoryParam( + (WalletType type, _) => PreSeedPage(type)); } diff --git a/lib/generated/i18n.dart b/lib/generated/i18n.dart index 2abfd2a18..59799342b 100644 --- a/lib/generated/i18n.dart +++ b/lib/generated/i18n.dart @@ -143,7 +143,7 @@ class S implements WidgetsLocalizations { String get please_select => "Please select:"; String get please_try_to_connect_to_another_node => "Please try to connect to another node"; String get pre_seed_button_text => "I understand. Show me my seed"; - String get pre_seed_description => "On the next page you will see a series of 25 words. This is your unique and private seed and it is the ONLY way to recover your wallet in case of loss or malfunction. It is YOUR responsibility to write it down and store it in a safe place outside of the Cake Wallet app."; + String pre_seed_description(int words) => "On the next page you will see a series of ${words} words. This is your unique and private seed and it is the ONLY way to recover your wallet in case of loss or malfunction. It is YOUR responsibility to write it down and store it in a safe place outside of the Cake Wallet app."; String get pre_seed_title => "IMPORTANT"; String get private_key => "Private key"; String get public_key => "Public key"; @@ -514,7 +514,7 @@ class $de extends S { @override String get choose_wallet_currency => "Bitte wählen Sie die Brieftaschenwährung:"; @override - String get pre_seed_description => "Auf der nächsten Seite sehen Sie eine Reihe von 25 Wörtern. Dies ist Ihr einzigartiger und privater Samen und der EINZIGE Weg, um Ihren Geldbeutel im Falle eines Verlusts oder einer Fehlfunktion wiederherzustellen. Es liegt in IHRER Verantwortung, es aufzuschreiben und an einem sicheren Ort außerhalb der Cake Wallet App aufzubewahren."; + String pre_seed_description(int words) => "Auf der nächsten Seite sehen Sie eine Reihe von ${words} Wörtern. Dies ist Ihr einzigartiger und privater Samen und der EINZIGE Weg, um Ihren Geldbeutel im Falle eines Verlusts oder einer Fehlfunktion wiederherzustellen. Es liegt in IHRER Verantwortung, es aufzuschreiben und an einem sicheren Ort außerhalb der Cake Wallet App aufzubewahren."; @override String get node_connection_successful => "Die Verbindung war erfolgreich"; @override @@ -1214,7 +1214,7 @@ class $hi extends S { @override String get choose_wallet_currency => "कृपया बटुआ मुद्रा चुनें:"; @override - String get pre_seed_description => "अगले पेज पर आपको 25 शब्दों की एक श्रृंखला दिखाई देगी। यह आपका अद्वितीय और निजी बीज है और नुकसान या खराबी के मामले में अपने बटुए को पुनर्प्राप्त करने का एकमात्र तरीका है। यह आपकी जिम्मेदारी है कि इसे नीचे लिखें और इसे Cake Wallet ऐप के बाहर सुरक्षित स्थान पर संग्रहीत करें।"; + String pre_seed_description(int words) => "अगले पेज पर आपको ${words} शब्दों की एक श्रृंखला दिखाई देगी। यह आपका अद्वितीय और निजी बीज है और नुकसान या खराबी के मामले में अपने बटुए को पुनर्प्राप्त करने का एकमात्र तरीका है। यह आपकी जिम्मेदारी है कि इसे नीचे लिखें और इसे Cake Wallet ऐप के बाहर सुरक्षित स्थान पर संग्रहीत करें।"; @override String get node_connection_successful => "कनेक्शन सफल रहा"; @override @@ -1914,7 +1914,7 @@ class $ru extends S { @override String get choose_wallet_currency => "Пожалуйста, выберите валюту кошелька:"; @override - String get pre_seed_description => "На следующей странице вы увидите серию из 25 слов. Это ваша уникальная и личная мнемоническая фраза, и это ЕДИНСТВЕННЫЙ способ восстановить свой кошелек в случае потери или неисправности. ВАМ необходимо записать ее и хранить в надежном месте вне приложения Cake Wallet."; + String pre_seed_description(int words) => "На следующей странице вы увидите серию из ${words} слов. Это ваша уникальная и личная мнемоническая фраза, и это ЕДИНСТВЕННЫЙ способ восстановить свой кошелек в случае потери или неисправности. ВАМ необходимо записать ее и хранить в надежном месте вне приложения Cake Wallet."; @override String get node_connection_successful => "Подключение прошло успешно"; @override @@ -2614,7 +2614,7 @@ class $ko extends S { @override String get choose_wallet_currency => "지갑 통화를 선택하십시오:"; @override - String get pre_seed_description => "다음 페이지에서 25 개의 단어를 볼 수 있습니다. 이것은 귀하의 고유하고 개인적인 시드이며 분실 또는 오작동시 지갑을 복구하는 유일한 방법입니다. 기록해두고 Cake Wallet 앱 외부의 안전한 장소에 보관하는 것은 귀하의 책임입니다."; + String pre_seed_description(int words) => "다음 페이지에서 ${words} 개의 단어를 볼 수 있습니다. 이것은 귀하의 고유하고 개인적인 시드이며 분실 또는 오작동시 지갑을 복구하는 유일한 방법입니다. 기록해두고 Cake Wallet 앱 외부의 안전한 장소에 보관하는 것은 귀하의 책임입니다."; @override String get node_connection_successful => "성공적으로 연결되었습니다."; @override @@ -3314,7 +3314,7 @@ class $pt extends S { @override String get choose_wallet_currency => "Escolha a moeda da carteira:"; @override - String get pre_seed_description => "Na próxima página, você verá uma série de 25 palavras. Esta é a sua semente única e privada e é a ÚNICA maneira de recuperar sua carteira em caso de perda ou mau funcionamento. É SUA responsabilidade anotá-lo e armazená-lo em um local seguro fora do aplicativo Cake Wallet."; + String pre_seed_description(int words) => "Na próxima página, você verá uma série de ${words} palavras. Esta é a sua semente única e privada e é a ÚNICA maneira de recuperar sua carteira em caso de perda ou mau funcionamento. É SUA responsabilidade anotá-lo e armazená-lo em um local seguro fora do aplicativo Cake Wallet."; @override String get node_connection_successful => "A conexão foi bem sucedida"; @override @@ -4014,7 +4014,7 @@ class $uk extends S { @override String get choose_wallet_currency => "Будь ласка, виберіть валюту гаманця:"; @override - String get pre_seed_description => "На наступній сторінці ви побачите серію з 25 слів. Це ваша унікальна та приватна мнемонічна фраза, і це ЄДИНИЙ спосіб відновити ваш гаманець на випадок втрати або несправності. ВАМ необхідно записати її та зберігати в безпечному місці поза програмою Cake Wallet."; + String pre_seed_description(int words) => "На наступній сторінці ви побачите серію з ${words} слів. Це ваша унікальна та приватна мнемонічна фраза, і це ЄДИНИЙ спосіб відновити ваш гаманець на випадок втрати або несправності. ВАМ необхідно записати її та зберігати в безпечному місці поза програмою Cake Wallet."; @override String get node_connection_successful => "З'єднання було успішним"; @override @@ -4714,7 +4714,7 @@ class $ja extends S { @override String get choose_wallet_currency => "ウォレット通貨を選択してください:"; @override - String get pre_seed_description => "次のページでは、一連の25語が表示されます。 これはあなたのユニークでプライベートなシードであり、紛失や誤動作が発生した場合にウォレットを回復する唯一の方法です。 それを書き留めて、Cake Wallet アプリの外の安全な場所に保管するのはあなたの責任です。"; + String pre_seed_description(int words) => "次のページでは、一連の${words}語が表示されます。 これはあなたのユニークでプライベートなシードであり、紛失や誤動作が発生した場合にウォレットを回復する唯一の方法です。 それを書き留めて、Cake Wallet アプリの外の安全な場所に保管するのはあなたの責任です。"; @override String get node_connection_successful => "接続に成功しました"; @override @@ -5418,7 +5418,7 @@ class $pl extends S { @override String get choose_wallet_currency => "Wybierz walutę portfela:"; @override - String get pre_seed_description => "Na następnej stronie zobaczysz serię 25 słów. To jest Twoje unikalne i prywatne ziarno i jest to JEDYNY sposób na odzyskanie portfela w przypadku utraty lub awarii. Twoim obowiązkiem jest zapisanie go i przechowywanie w bezpiecznym miejscu poza aplikacją Cake Wallet."; + String pre_seed_description(int words) => "Na następnej stronie zobaczysz serię ${words} słów. To jest Twoje unikalne i prywatne ziarno i jest to JEDYNY sposób na odzyskanie portfela w przypadku utraty lub awarii. Twoim obowiązkiem jest zapisanie go i przechowywanie w bezpiecznym miejscu poza aplikacją Cake Wallet."; @override String get node_connection_successful => "Połączenie powiodło się"; @override @@ -6118,7 +6118,7 @@ class $es extends S { @override String get choose_wallet_currency => "Por favor, elija la moneda de la billetera:"; @override - String get pre_seed_description => "En la página siguiente verá una serie de 25 palabras. Esta es su semilla única y privada y es la ÚNICA forma de recuperar su billetera en caso de pérdida o mal funcionamiento. Es SU responsabilidad escribirlo y guardarlo en un lugar seguro fuera de la aplicación Cake Wallet."; + String pre_seed_description(int words) => "En la página siguiente verá una serie de ${words} palabras. Esta es su semilla única y privada y es la ÚNICA forma de recuperar su billetera en caso de pérdida o mal funcionamiento. Es SU responsabilidad escribirlo y guardarlo en un lugar seguro fuera de la aplicación Cake Wallet."; @override String get node_connection_successful => "La conexión fue exitosa"; @override @@ -6818,7 +6818,7 @@ class $nl extends S { @override String get choose_wallet_currency => "Kies een portemonnee-valuta:"; @override - String get pre_seed_description => "Op de volgende pagina ziet u een reeks van 25 woorden. Dit is uw unieke en persoonlijke zaadje en het is de ENIGE manier om uw portemonnee te herstellen in geval van verlies of storing. Het is JOUW verantwoordelijkheid om het op te schrijven en op een veilige plaats op te slaan buiten de Cake Wallet app."; + String pre_seed_description(int words) => "Op de volgende pagina ziet u een reeks van ${words} woorden. Dit is uw unieke en persoonlijke zaadje en het is de ENIGE manier om uw portemonnee te herstellen in geval van verlies of storing. Het is JOUW verantwoordelijkheid om het op te schrijven en op een veilige plaats op te slaan buiten de Cake Wallet app."; @override String get node_connection_successful => "Verbinding is gelukt"; @override @@ -7518,7 +7518,7 @@ class $zh extends S { @override String get choose_wallet_currency => "請選擇錢包貨幣:"; @override - String get pre_seed_description => "在下一頁上,您將看到一系列25個單詞。 這是您獨特的私人種子,是丟失或出現故障時恢復錢包的唯一方法。 您有責任將其寫下並存儲在Cake Wallet應用程序外部的安全地方。"; + String pre_seed_description(int words) => "在下一頁上,您將看到一系列${words}個單詞。 這是您獨特的私人種子,是丟失或出現故障時恢復錢包的唯一方法。 您有責任將其寫下並存儲在Cake Wallet應用程序外部的安全地方。"; @override String get node_connection_successful => "連接成功"; @override diff --git a/lib/router.dart b/lib/router.dart index d2122a031..93b56071b 100644 --- a/lib/router.dart +++ b/lib/router.dart @@ -71,8 +71,9 @@ Route createRoute(RouteSettings settings) { case Routes.newWalletType: return CupertinoPageRoute( builder: (_) => getIt.get( - param1: (BuildContext context, WalletType _) => - Navigator.of(context).pushNamed(Routes.preSeed, arguments: true), + param1: (BuildContext context, WalletType type) => + Navigator.of(context) + .pushNamed(Routes.preSeed, arguments: type), param2: true)); case Routes.newWallet: @@ -137,7 +138,8 @@ Route createRoute(RouteSettings settings) { return CupertinoPageRoute( builder: (_) => getIt.get( param1: (PinCodeState context, dynamic _) => - Navigator.pushNamed(context.context, Routes.restoreWalletType)), + Navigator.pushNamed( + context.context, Routes.restoreWalletType)), fullscreenDialog: true); case Routes.seed: @@ -147,8 +149,8 @@ Route createRoute(RouteSettings settings) { case Routes.restoreWallet: return MaterialPageRoute( - builder: (_) => - getIt.get(param1: settings.arguments as WalletType)); + builder: (_) => getIt.get( + param1: settings.arguments as WalletType)); case Routes.restoreWalletFromSeed: final type = settings.arguments as WalletType; @@ -248,7 +250,7 @@ Route createRoute(RouteSettings settings) { case Routes.accountCreation: return CupertinoPageRoute( builder: (_) => getIt.get( - param1: settings.arguments as AccountListItem)); + param1: settings.arguments as AccountListItem)); case Routes.addressBook: return MaterialPageRoute( @@ -311,7 +313,8 @@ Route createRoute(RouteSettings settings) { case Routes.preSeed: return MaterialPageRoute( - builder: (_) => getIt.get()); + builder: (_) => + getIt.get(param1: settings.arguments as WalletType)); default: return MaterialPageRoute( diff --git a/lib/src/screens/dashboard/widgets/balance_page.dart b/lib/src/screens/dashboard/widgets/balance_page.dart index 7409a78ef..01fb42495 100644 --- a/lib/src/screens/dashboard/widgets/balance_page.dart +++ b/lib/src/screens/dashboard/widgets/balance_page.dart @@ -59,14 +59,15 @@ class BalancePage extends StatelessWidget { return AutoSizeText( dashboardViewModel.balanceViewModel.cryptoBalance, style: TextStyle( - fontSize: 40, + fontSize: 54, fontWeight: FontWeight.bold, color: Theme.of(context) .accentTextTheme .display3 .backgroundColor, height: 1), - ); + maxLines: 1, + textAlign: TextAlign.center); }), SizedBox(height: 10), Observer(builder: (_) { diff --git a/lib/src/screens/seed/pre_seed_page.dart b/lib/src/screens/seed/pre_seed_page.dart index 0a2bc0161..babbf33ec 100644 --- a/lib/src/screens/seed/pre_seed_page.dart +++ b/lib/src/screens/seed/pre_seed_page.dart @@ -1,3 +1,4 @@ +import 'package:cake_wallet/entities/wallet_type.dart'; import 'package:cake_wallet/routes.dart'; import 'package:cake_wallet/themes/theme_base.dart'; import 'package:flutter/cupertino.dart'; @@ -7,8 +8,17 @@ import 'package:cake_wallet/src/widgets/primary_button.dart'; import 'package:cake_wallet/src/screens/base_page.dart'; class PreSeedPage extends BasePage { - final imageLight = Image.asset('assets/images/pre_seed_light.png'); - final imageDark = Image.asset('assets/images/pre_seed_dark.png'); + PreSeedPage(this.type) + : imageLight = Image.asset('assets/images/pre_seed_light.png'), + imageDark = Image.asset('assets/images/pre_seed_dark.png'), + wordsCount = type == WalletType.monero + ? 25 + : 12; // FIXME: Stupid fast implementation + + final Image imageDark; + final Image imageLight; + final WalletType type; + final int wordsCount; @override Widget leading(BuildContext context) => null; @@ -39,7 +49,7 @@ class PreSeedPage extends BasePage { Padding( padding: EdgeInsets.only(top: 70, left: 16, right: 16), child: Text( - S.of(context).pre_seed_description, + S.of(context).pre_seed_description(wordsCount), textAlign: TextAlign.center, style: TextStyle( fontSize: 14,