diff --git a/lib/providers/duniter_indexer.dart b/lib/providers/duniter_indexer.dart index c7527fe..0803349 100644 --- a/lib/providers/duniter_indexer.dart +++ b/lib/providers/duniter_indexer.dart @@ -8,7 +8,6 @@ import 'package:gecko/globals.dart'; import 'package:gecko/models/queries_indexer.dart'; import 'package:gecko/providers/substrate_sdk.dart'; import 'package:graphql_flutter/graphql_flutter.dart'; -import 'package:provider/provider.dart'; class DuniterIndexer with ChangeNotifier { Map walletNameIndexer = {}; @@ -264,8 +263,6 @@ Map computeHistoryView(repository, String address) { DateTime now = DateTime.now(); final bool isUdUnit = configBox.get('isUdUnit') ?? false; - final sub = Provider.of(homeContext, listen: false); - late double amount; late String finalAmount; DateTime date = repository[0]; @@ -325,13 +322,15 @@ Map computeHistoryView(repository, String address) { isMigrationTime = false; } - log.d('taaaaaaaaaaaaaa: $date'); - log.d('taaaaaaa: ${sub.oldOwnerKeys[address]?[1]}'); - if (date.compareTo(sub.oldOwnerKeys[address]?[1] ?? DateTime(2000)) < 0) { - isChangeOwnerkeyTime = true; - } else { - isChangeOwnerkeyTime = false; - } + //TODO: Migration date and transaction migration doesn't match, add this event to v2s indexer. + // log.d('debug date transaction: $date'); + // log.d('debug date identity migration: ${sub.oldOwnerKeys[address]?[1]}'); + // if (date.compareTo(sub.oldOwnerKeys[address]?[1] ?? DateTime(2000)) < 0) { + // log.d('taaaaaaaaa: GOOOO'); + // isChangeOwnerkeyTime = true; + // } else { + // isChangeOwnerkeyTime = false; + // } return { 'finalAmount': finalAmount, diff --git a/lib/widgets/history_view.dart b/lib/widgets/history_view.dart index 9827fbc..c483814 100644 --- a/lib/widgets/history_view.dart +++ b/lib/widgets/history_view.dart @@ -2,6 +2,9 @@ import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:gecko/globals.dart'; import 'package:gecko/providers/duniter_indexer.dart'; +import 'package:gecko/providers/substrate_sdk.dart'; +import 'package:gecko/screens/wallet_view.dart'; +import 'package:gecko/widgets/page_route_no_transition.dart'; import 'package:gecko/widgets/transaction_tile.dart'; import 'package:graphql_flutter/graphql_flutter.dart'; import 'package:provider/provider.dart'; @@ -18,6 +21,8 @@ class HistoryView extends StatelessWidget { @override Widget build(BuildContext context) { final duniterIndexer = Provider.of(context, listen: false); + final sub = Provider.of(homeContext, listen: false); + int keyID = 0; const double avatarSize = 200; bool isMigrationPassed = false; @@ -66,28 +71,6 @@ class HistoryView extends StatelessWidget { ], ), ), - if (answer['isChangeOwnerkeyTime']) - Padding( - padding: const EdgeInsets.symmetric(vertical: 30), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - const Image( - image: AssetImage('assets/party.png'), height: 40), - const SizedBox(width: 40), - Text( - 'Identité migré !'.tr(), - style: const TextStyle( - fontSize: 25, - color: Colors.blueAccent, - fontWeight: FontWeight.w500), - ), - const SizedBox(width: 40), - const Image( - image: AssetImage('assets/party.png'), height: 40), - ], - ), - ), if (pastDelimiters.length == 1 || pastDelimiters.length >= 2 && !(pastDelimiters[pastDelimiters.length - 2] == @@ -119,6 +102,50 @@ class HistoryView extends StatelessWidget { CircularProgressIndicator(), ], ), + if (!duniterIndexer.pageInfo!['hasNextPage'] && + sub.oldOwnerKeys[address]?[0] != null) + Padding( + padding: const EdgeInsets.symmetric(vertical: 30), + child: InkWell( + onTap: () => Navigator.push( + context, + PageNoTransit(builder: (context) { + return WalletViewScreen( + address: sub.oldOwnerKeys[address]![0], + username: '', + ); + }), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const Icon( + Icons.account_circle, + size: 40, + color: Colors.blueAccent, + ), + const SizedBox(width: 40), + Column(children: [ + Text( + 'Identité migré:'.tr(), + style: const TextStyle( + fontSize: 25, + color: Colors.blueAccent, + fontWeight: FontWeight.w500), + ), + Text( + 'Ancienne adresse: ${getShortPubkey(sub.oldOwnerKeys[address]![0])}') + ]), + const SizedBox(width: 40), + const Icon( + Icons.account_circle, + size: 40, + color: Colors.blueAccent, + ), + ], + ), + ), + ), if (!duniterIndexer.pageInfo!['hasNextPage']) Column( children: [ diff --git a/pubspec.lock b/pubspec.lock index c4b62d5..f106be7 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,10 +5,10 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: "503361166f4a100e0d7eb7fb5a62c6f0322512f2bcb48d6922caf98f24b0ab90" + sha256: a36ec4843dc30ea6bf652bf25e3448db6c5e8bcf4aa55f063a5d1dad216d8214 url: "https://pub.dev" source: hosted - version: "56.0.0" + version: "58.0.0" accordion: dependency: "direct main" description: @@ -21,10 +21,10 @@ packages: dependency: transitive description: name: analyzer - sha256: "93fcd81a6716e69864516750590cf1e699420615046bda19100238aa7b429785" + sha256: cc4242565347e98424ce9945c819c192ec0838cb9d1f6aa4a97cc96becbc5b27 url: "https://pub.dev" source: hosted - version: "5.8.0" + version: "5.10.0" analyzer_plugin: dependency: transitive description: @@ -237,10 +237,10 @@ packages: dependency: transitive description: name: cli_util - sha256: "66f86e916d285c1a93d3b79587d94bd71984a66aac4ff74e524cfa7877f1395c" + sha256: b8db3080e59b2503ca9e7922c3df2072cf13992354d5e944074ffa836fba43b7 url: "https://pub.dev" source: hosted - version: "0.3.5" + version: "0.4.0" clock: dependency: transitive description: @@ -325,18 +325,18 @@ packages: dependency: "direct dev" description: name: dart_code_metrics - sha256: "728b1835a8c5b994ae8111148b427236f2f89954eebcb62baf4c476909b3d02d" + sha256: "7d16c5cf8648ad44de679040f7ee0fdc0ac751ad2769a4ea49fed54f58e98c98" url: "https://pub.dev" source: hosted - version: "5.7.0" + version: "5.7.1" dart_code_metrics_presets: dependency: transitive description: name: dart_code_metrics_presets - sha256: "1b841b3ab3e7b942683a706cfbcef55fe9f38e7d01b690dbcd2e9f3c8e268525" + sha256: "9c9b0ecc5e23937a4b62c1fe3b3edb72d3c1b08563a1eac69fb75f1306bb57c4" url: "https://pub.dev" source: hosted - version: "1.5.0" + version: "1.6.0" dart_style: dependency: transitive description: @@ -511,10 +511,10 @@ packages: dependency: "direct dev" description: name: flutter_launcher_icons - sha256: "02dcaf49d405f652b7160e882bacfc02cb497041bb2eab2a49b1c393cf9aac12" + sha256: "8546a9b9510e1a260b8d55fb2d07096e8a8552c6a2c2bf529100344894b2b41a" url: "https://pub.dev" source: hosted - version: "0.12.0" + version: "0.13.0" flutter_lints: dependency: "direct main" description: @@ -811,10 +811,10 @@ packages: dependency: transitive description: name: image_picker_ios - sha256: d4cb8ab04f770dab9d04c7959e5f6d22e8c5280343d425f9344f93832cf58445 + sha256: a1546ff5861fc15812953d4733b520c3d371cec3d2859a001ff04c46c4d81883 url: "https://pub.dev" source: hosted - version: "0.8.7+2" + version: "0.8.7+3" image_picker_platform_interface: dependency: transitive description: @@ -1266,10 +1266,10 @@ packages: dependency: "direct main" description: name: riverpod - sha256: b0fbf7927333c5c318f7e2c22c8b4fd2542ba294de0373e80ecdb34e0dcd8dc4 + sha256: "77ab3bcd084bb19fa8717a526217787c725d7f5be938404c7839cd760fdf6ae5" url: "https://pub.dev" source: hosted - version: "2.3.2" + version: "2.3.4" rxdart: dependency: transitive description: @@ -1298,26 +1298,26 @@ packages: dependency: transitive description: name: sentry - sha256: a1529c545fcbc899e5dcc7c94ff1c6ad0c334dfc99a3cda366b1da98af7c5678 + sha256: dda9b82b4a8a7d778786453ac6d57fb566fb9d12425d79628d295e7c6793c89f url: "https://pub.dev" source: hosted - version: "6.22.0" + version: "7.4.1" sentry_flutter: dependency: "direct main" description: name: sentry_flutter - sha256: cab07e99a8f27af94f399cabceaff6968011660505b30a0e2286728a81bc476c + sha256: "9082c7c13e07c43c0ecb91558549166191e4dd513a6ec6810b1ae3bc072683fc" url: "https://pub.dev" source: hosted - version: "6.22.0" + version: "7.4.1" shared_preferences: dependency: "direct main" description: name: shared_preferences - sha256: "78528fd87d0d08ffd3e69551173c026e8eacc7b7079c82eb6a77413957b7e394" + sha256: "858aaa72d8f61637d64e776aca82e1c67e6d9ee07979123c5d17115031c1b13b" url: "https://pub.dev" source: hosted - version: "2.0.20" + version: "2.1.0" shared_preferences_android: dependency: transitive description: @@ -1543,10 +1543,10 @@ packages: dependency: transitive description: name: url_launcher_ios - sha256: "3dedc66ca3c0bef9e6a93c0999aee102556a450afcc1b7bcfeace7a424927d92" + sha256: "9af7ea73259886b92199f9e42c116072f05ff9bea2dcb339ab935dfc957392c2" url: "https://pub.dev" source: hosted - version: "6.1.3" + version: "6.1.4" url_launcher_linux: dependency: transitive description: @@ -1711,10 +1711,10 @@ packages: dependency: transitive description: name: win32 - sha256: c9ebe7ee4ab0c2194e65d3a07d8c54c5d00bb001b76081c4a04cdb8448b59e46 + sha256: a6f0236dbda0f63aa9a25ad1ff9a9d8a4eaaa5012da0dc59d21afdb1dc361ca4 url: "https://pub.dev" source: hosted - version: "3.1.3" + version: "3.1.4" xdg_directories: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 9cf471f..e4f6b85 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -5,7 +5,7 @@ description: Pay with G1. # pub.dev using `pub publish`. This is preferred for private packages. publish_to: 'none' # Remove this line if you wish to publish to pub.dev -version: 0.1.0+56 +version: 0.1.0+57 environment: sdk: '>=2.12.0 <3.0.0' @@ -35,7 +35,7 @@ dependencies: url: https://github.com/insinfo/qr.flutter.git ref: master responsive_framework: ^0.2.0 - sentry_flutter: ^6.18.0 + sentry_flutter: ^7.4.1 shared_preferences: ^2.0.7 truncate: ^3.0.1 unorm_dart: ^0.2.0 @@ -70,7 +70,7 @@ dependencies: dev_dependencies: # flutter_launcher_icons: ^0.9.2 # flutter_launcher_icons_maker: ^^0.10.2 - flutter_launcher_icons: ^0.12.0 + flutter_launcher_icons: ^0.13.0 icons_launcher: ^2.0.6 build_runner: ^2.1.2 flutter_test: