diff --git a/lib/pages/wallet_view/sub_widgets/transactions_list.dart b/lib/pages/wallet_view/sub_widgets/transactions_list.dart index 71f56ccad..360b3028b 100644 --- a/lib/pages/wallet_view/sub_widgets/transactions_list.dart +++ b/lib/pages/wallet_view/sub_widgets/transactions_list.dart @@ -5,7 +5,6 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/models/isar/models/isar_models.dart'; import 'package:stackwallet/pages/exchange_view/trade_details_view.dart'; import 'package:stackwallet/pages/wallet_view/sub_widgets/no_transactions_found.dart'; -import 'package:stackwallet/providers/blockchain/dogecoin/current_height_provider.dart'; import 'package:stackwallet/providers/global/trades_service_provider.dart'; import 'package:stackwallet/providers/global/wallets_provider.dart'; import 'package:stackwallet/route_generator.dart'; @@ -85,7 +84,13 @@ class _TransactionsListState extends ConsumerState { children: [ TransactionCard( // this may mess with combined firo transactions - key: Key(tx.txid + tx.type.name + tx.address.value.toString()), // + key: Key(tx.txid + + tx.type.name + + tx.address.value.toString() + + ref + .watch(widget.managerProvider + .select((value) => value.currentHeight)) + .toString()), // transaction: tx, walletId: widget.walletId, ), @@ -180,7 +185,13 @@ class _TransactionsListState extends ConsumerState { ), child: TransactionCard( // this may mess with combined firo transactions - key: Key(tx.txid + tx.type.name + tx.address.value.toString()), // + key: Key(tx.txid + + tx.type.name + + tx.address.value.toString() + + ref + .watch(widget.managerProvider + .select((value) => value.currentHeight)) + .toString()), // transaction: tx, walletId: widget.walletId, ), @@ -188,13 +199,6 @@ class _TransactionsListState extends ConsumerState { } } - void updateHeightProvider(Manager manager) { - WidgetsBinding.instance.addPostFrameCallback((timeStamp) { - ref.read(currentHeightProvider(manager.coin).state).state = - manager.currentHeight; - }); - } - @override void initState() { managerProvider = widget.managerProvider; @@ -203,14 +207,9 @@ class _TransactionsListState extends ConsumerState { @override Widget build(BuildContext context) { - // final managerProvider = ref - // .watch(walletsChangeNotifierProvider) - // .getManagerProvider(widget.walletId); - final manager = ref.watch(walletsChangeNotifierProvider .select((value) => value.getManager(widget.walletId))); - updateHeightProvider(manager); return FutureBuilder( future: manager.transactions, builder: (fbContext, AsyncSnapshot> snapshot) { diff --git a/lib/pages/wallet_view/transaction_views/all_transactions_view.dart b/lib/pages/wallet_view/transaction_views/all_transactions_view.dart index 6ebb5bd1c..c9ba6181b 100644 --- a/lib/pages/wallet_view/transaction_views/all_transactions_view.dart +++ b/lib/pages/wallet_view/transaction_views/all_transactions_view.dart @@ -10,7 +10,6 @@ import 'package:stackwallet/notifications/show_flush_bar.dart'; import 'package:stackwallet/pages/wallet_view/sub_widgets/tx_icon.dart'; import 'package:stackwallet/pages/wallet_view/transaction_views/transaction_details_view.dart'; import 'package:stackwallet/pages/wallet_view/transaction_views/transaction_search_filter_view.dart'; -import 'package:stackwallet/providers/blockchain/dogecoin/current_height_provider.dart'; import 'package:stackwallet/providers/global/address_book_service_provider.dart'; import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/providers/ui/transaction_filter_provider.dart'; @@ -131,7 +130,9 @@ class _TransactionDetailsViewState extends ConsumerState { // check if address book name contains contains |= contacts .where((e) => - e.addresses.where((a) => a.address == tx.address).isNotEmpty && + e.addresses + .where((a) => a.address == tx.address.value?.value) + .isNotEmpty && e.name.toLowerCase().contains(keyword)) .isNotEmpty; @@ -853,7 +854,8 @@ class _DesktopTransactionCardRowState prefix = ""; } - final currentHeight = ref.watch(currentHeightProvider(coin).state).state; + final currentHeight = ref.watch(walletsChangeNotifierProvider + .select((value) => value.getManager(walletId).currentHeight)); return Material( color: Theme.of(context).extension()!.popupBG, diff --git a/lib/pages/wallet_view/transaction_views/transaction_details_view.dart b/lib/pages/wallet_view/transaction_views/transaction_details_view.dart index f2755f547..af82a250d 100644 --- a/lib/pages/wallet_view/transaction_views/transaction_details_view.dart +++ b/lib/pages/wallet_view/transaction_views/transaction_details_view.dart @@ -11,7 +11,6 @@ import 'package:stackwallet/pages/wallet_view/sub_widgets/tx_icon.dart'; import 'package:stackwallet/pages/wallet_view/transaction_views/dialogs/cancelling_transaction_progress_dialog.dart'; import 'package:stackwallet/pages/wallet_view/transaction_views/edit_note_view.dart'; import 'package:stackwallet/pages/wallet_view/wallet_view.dart'; -import 'package:stackwallet/providers/blockchain/dogecoin/current_height_provider.dart'; import 'package:stackwallet/providers/global/address_book_service_provider.dart'; import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/services/coins/epiccash/epiccash_wallet.dart'; @@ -298,7 +297,8 @@ class _TransactionDetailsViewState @override Widget build(BuildContext context) { - final currentHeight = ref.watch(currentHeightProvider(coin).state).state; + final currentHeight = ref.watch(walletsChangeNotifierProvider + .select((value) => value.getManager(walletId).currentHeight)); return ConditionalParent( condition: !isDesktop, diff --git a/lib/providers/blockchain/dogecoin/current_height_provider.dart b/lib/providers/blockchain/dogecoin/current_height_provider.dart deleted file mode 100644 index 22b6711db..000000000 --- a/lib/providers/blockchain/dogecoin/current_height_provider.dart +++ /dev/null @@ -1,6 +0,0 @@ -import 'package:dart_numerics/dart_numerics.dart'; -import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:stackwallet/utilities/enums/coin_enum.dart'; - -final currentHeightProvider = - StateProvider.family((ref, coin) => int64MaxValue); diff --git a/lib/widgets/transaction_card.dart b/lib/widgets/transaction_card.dart index 031234142..1b19a2380 100644 --- a/lib/widgets/transaction_card.dart +++ b/lib/widgets/transaction_card.dart @@ -6,7 +6,6 @@ import 'package:stackwallet/models/isar/models/isar_models.dart'; import 'package:stackwallet/notifications/show_flush_bar.dart'; import 'package:stackwallet/pages/wallet_view/sub_widgets/tx_icon.dart'; import 'package:stackwallet/pages/wallet_view/transaction_views/transaction_details_view.dart'; -import 'package:stackwallet/providers/blockchain/dogecoin/current_height_provider.dart'; import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; @@ -121,7 +120,8 @@ class _TransactionCardState extends ConsumerState { } } - final currentHeight = ref.watch(currentHeightProvider(coin).state).state; + final currentHeight = ref.watch(walletsChangeNotifierProvider + .select((value) => value.getManager(walletId).currentHeight)); return Material( color: Theme.of(context).extension()!.popupBG,