From 39d87c765a23fe6ae12c4c069cbf92a620d2b59a Mon Sep 17 00:00:00 2001 From: poka <poka@p2p.legal> Date: Fri, 8 Jul 2022 23:23:05 +0200 Subject: [PATCH] fix: show no data message if history profile is empty --- .metadata | 24 +++++++++++++++++-- .../gecko/axiomteam/gecko/MainActivity.kt | 6 +++++ .../res/drawable-v21/launch_background.xml | 12 ++++++++++ .../app/src/main/res/values-night/styles.xml | 18 ++++++++++++++ assets/translations/en.json | 2 +- assets/translations/es.json | 2 +- assets/translations/fr.json | 2 +- lib/main.dart | 2 +- lib/providers/generate_wallets.dart | 1 - lib/providers/substrate_sdk.dart | 3 +-- lib/screens/activity.dart | 3 ++- 11 files changed, 65 insertions(+), 10 deletions(-) create mode 100644 android/app/src/main/kotlin/gecko/axiomteam/gecko/MainActivity.kt create mode 100644 android/app/src/main/res/drawable-v21/launch_background.xml create mode 100644 android/app/src/main/res/values-night/styles.xml diff --git a/.metadata b/.metadata index f0274b3e..245a8e8c 100644 --- a/.metadata +++ b/.metadata @@ -1,10 +1,30 @@ # This file tracks properties of this Flutter project. # Used by Flutter tool to assess capabilities and perform upgrades etc. # -# This file should be version controlled and should not be manually edited. +# This file should be version controlled. version: - revision: 1aafb3a8b9b0c36241c5f5b34ee914770f015818 + revision: 85684f9300908116a78138ea4c6036c35c9a1236 channel: stable project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: 85684f9300908116a78138ea4c6036c35c9a1236 + base_revision: 85684f9300908116a78138ea4c6036c35c9a1236 + - platform: android + create_revision: 85684f9300908116a78138ea4c6036c35c9a1236 + base_revision: 85684f9300908116a78138ea4c6036c35c9a1236 + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/android/app/src/main/kotlin/gecko/axiomteam/gecko/MainActivity.kt b/android/app/src/main/kotlin/gecko/axiomteam/gecko/MainActivity.kt new file mode 100644 index 00000000..0a5e37bf --- /dev/null +++ b/android/app/src/main/kotlin/gecko/axiomteam/gecko/MainActivity.kt @@ -0,0 +1,6 @@ +package gecko.axiomteam.gecko + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity: FlutterActivity() { +} diff --git a/android/app/src/main/res/drawable-v21/launch_background.xml b/android/app/src/main/res/drawable-v21/launch_background.xml new file mode 100644 index 00000000..f74085f3 --- /dev/null +++ b/android/app/src/main/res/drawable-v21/launch_background.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Modify this file to customize your launch splash screen --> +<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:drawable="?android:colorBackground" /> + + <!-- You can insert your own image assets here --> + <!-- <item> + <bitmap + android:gravity="center" + android:src="@mipmap/launch_image" /> + </item> --> +</layer-list> diff --git a/android/app/src/main/res/values-night/styles.xml b/android/app/src/main/res/values-night/styles.xml new file mode 100644 index 00000000..06952be7 --- /dev/null +++ b/android/app/src/main/res/values-night/styles.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on --> + <style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar"> + <!-- Show a splash screen on the activity. Automatically removed when + the Flutter engine draws its first frame --> + <item name="android:windowBackground">@drawable/launch_background</item> + </style> + <!-- Theme applied to the Android Window as soon as the process has started. + This theme determines the color of the Android Window while your + Flutter UI initializes, as well as behind your Flutter UI while its + running. + + This Theme is only used starting with V2 of Flutter's Android embedding. --> + <style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar"> + <item name="android:windowBackground">?android:colorBackground</item> + </style> +</resources> diff --git a/assets/translations/en.json b/assets/translations/en.json index 478705a5..2d1f4f1f 100644 --- a/assets/translations/en.json +++ b/assets/translations/en.json @@ -109,7 +109,7 @@ "accountActivity": "Account activity", "noNetworkNoHistory": "Network state does not allow\nto display account history", "noDataToDisplay": "No data to be displayed.", - "noTranscationToDisplay": "No transaction to display", + "noTransactionToDisplay": "No transaction to display", "month1": "January", "month2": "February", "month3": "March", diff --git a/assets/translations/es.json b/assets/translations/es.json index 340944d2..a7299ecf 100644 --- a/assets/translations/es.json +++ b/assets/translations/es.json @@ -109,7 +109,7 @@ "accountActivity": "Account activity", "noNetworkNoHistory": "Network state does not allow\nto display account history", "noDataToDisplay": "No data to be displayed.", - "noTranscationToDisplay": "No transaction to display", + "noTransactionToDisplay": "No transaction to display", "month1": "January", "month2": "February", "month3": "March", diff --git a/assets/translations/fr.json b/assets/translations/fr.json index 98b185bf..963e0712 100644 --- a/assets/translations/fr.json +++ b/assets/translations/fr.json @@ -110,7 +110,7 @@ "accountActivity": "Activité du compte", "noNetworkNoHistory": "L'état du réseau ne permet pas\nd'afficher l'historique du compte", "noDataToDisplay": "Aucune donnée à afficher.", - "noTranscationToDisplay": "Aucune transaction à afficher", + "noTransactionToDisplay": "Aucune transaction à afficher", "month1": "Janvier", "month2": "Février", "month3": "Mars", diff --git a/lib/main.dart b/lib/main.dart index 9c20360f..210b2573 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -106,7 +106,7 @@ Future<void> main() async { }, appRunner: () => runApp( EasyLocalization( - supportedLocales: const [Locale('en'), Locale('fr')], + supportedLocales: const [Locale('en'), Locale('fr'), Locale('es')], path: 'assets/translations', fallbackLocale: const Locale('en'), child: Gecko(indexerEndpoint), diff --git a/lib/providers/generate_wallets.dart b/lib/providers/generate_wallets.dart index 5fec56dc..fa4b8696 100644 --- a/lib/providers/generate_wallets.dart +++ b/lib/providers/generate_wallets.dart @@ -369,7 +369,6 @@ class GenerateWalletsProvider with ChangeNotifier { Future<bool> scanDerivations(BuildContext context, {int numberScan = 20}) async { SubstrateSdk _sub = Provider.of<SubstrateSdk>(context, listen: false); - final ss58 = _sub.ss58; final currentChestNumber = configBox.get('currentChest'); bool isAlive = false; scanedWalletNumber = 0; diff --git a/lib/providers/substrate_sdk.dart b/lib/providers/substrate_sdk.dart index dcd6d55c..5de4a376 100644 --- a/lib/providers/substrate_sdk.dart +++ b/lib/providers/substrate_sdk.dart @@ -19,8 +19,6 @@ import 'package:truncate/truncate.dart'; // import 'package:web_socket_channel/io.dart'; class SubstrateSdk with ChangeNotifier { - final int ss58 = 42; - final WalletSDK sdk = WalletSDK(); final Keyring keyring = Keyring(); String generatedMnemonic = ''; @@ -262,6 +260,7 @@ class SubstrateSdk with ChangeNotifier { Future<double> getBalance(String address, {bool isUd = false}) async { double balance = 0.0; + // log.d('nodeConnected: ' + nodeConnected.toString()); if (nodeConnected) { final brutBalance = await sdk.api.account.queryBalance(address); diff --git a/lib/screens/activity.dart b/lib/screens/activity.dart index ff682f98..f3c76ec6 100644 --- a/lib/screens/activity.dart +++ b/lib/screens/activity.dart @@ -111,7 +111,8 @@ class ActivityScreen extends StatelessWidget with ChangeNotifier { style: const TextStyle(fontSize: 18), ) ]); - } else if (result.data == null) { + } else if (result + .data?['transaction_connection']?['edges'].isEmpty) { return Column(children: <Widget>[ const SizedBox(height: 50), Text( -- GitLab