mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-03 17:29:23 +00:00
update ui transaction state fix
This commit is contained in:
parent
a41f80ac55
commit
225aec1763
5 changed files with 23 additions and 28 deletions
|
@ -5,7 +5,6 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
import 'package:stackwallet/models/isar/models/isar_models.dart';
|
import 'package:stackwallet/models/isar/models/isar_models.dart';
|
||||||
import 'package:stackwallet/pages/exchange_view/trade_details_view.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/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/trades_service_provider.dart';
|
||||||
import 'package:stackwallet/providers/global/wallets_provider.dart';
|
import 'package:stackwallet/providers/global/wallets_provider.dart';
|
||||||
import 'package:stackwallet/route_generator.dart';
|
import 'package:stackwallet/route_generator.dart';
|
||||||
|
@ -85,7 +84,13 @@ class _TransactionsListState extends ConsumerState<TransactionsList> {
|
||||||
children: [
|
children: [
|
||||||
TransactionCard(
|
TransactionCard(
|
||||||
// this may mess with combined firo transactions
|
// 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,
|
transaction: tx,
|
||||||
walletId: widget.walletId,
|
walletId: widget.walletId,
|
||||||
),
|
),
|
||||||
|
@ -180,7 +185,13 @@ class _TransactionsListState extends ConsumerState<TransactionsList> {
|
||||||
),
|
),
|
||||||
child: TransactionCard(
|
child: TransactionCard(
|
||||||
// this may mess with combined firo transactions
|
// 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,
|
transaction: tx,
|
||||||
walletId: widget.walletId,
|
walletId: widget.walletId,
|
||||||
),
|
),
|
||||||
|
@ -188,13 +199,6 @@ class _TransactionsListState extends ConsumerState<TransactionsList> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void updateHeightProvider(Manager manager) {
|
|
||||||
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
|
|
||||||
ref.read(currentHeightProvider(manager.coin).state).state =
|
|
||||||
manager.currentHeight;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
managerProvider = widget.managerProvider;
|
managerProvider = widget.managerProvider;
|
||||||
|
@ -203,14 +207,9 @@ class _TransactionsListState extends ConsumerState<TransactionsList> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
// final managerProvider = ref
|
|
||||||
// .watch(walletsChangeNotifierProvider)
|
|
||||||
// .getManagerProvider(widget.walletId);
|
|
||||||
|
|
||||||
final manager = ref.watch(walletsChangeNotifierProvider
|
final manager = ref.watch(walletsChangeNotifierProvider
|
||||||
.select((value) => value.getManager(widget.walletId)));
|
.select((value) => value.getManager(widget.walletId)));
|
||||||
|
|
||||||
updateHeightProvider(manager);
|
|
||||||
return FutureBuilder(
|
return FutureBuilder(
|
||||||
future: manager.transactions,
|
future: manager.transactions,
|
||||||
builder: (fbContext, AsyncSnapshot<List<Transaction>> snapshot) {
|
builder: (fbContext, AsyncSnapshot<List<Transaction>> snapshot) {
|
||||||
|
|
|
@ -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/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_details_view.dart';
|
||||||
import 'package:stackwallet/pages/wallet_view/transaction_views/transaction_search_filter_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/global/address_book_service_provider.dart';
|
||||||
import 'package:stackwallet/providers/providers.dart';
|
import 'package:stackwallet/providers/providers.dart';
|
||||||
import 'package:stackwallet/providers/ui/transaction_filter_provider.dart';
|
import 'package:stackwallet/providers/ui/transaction_filter_provider.dart';
|
||||||
|
@ -131,7 +130,9 @@ class _TransactionDetailsViewState extends ConsumerState<AllTransactionsView> {
|
||||||
// check if address book name contains
|
// check if address book name contains
|
||||||
contains |= contacts
|
contains |= contacts
|
||||||
.where((e) =>
|
.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))
|
e.name.toLowerCase().contains(keyword))
|
||||||
.isNotEmpty;
|
.isNotEmpty;
|
||||||
|
|
||||||
|
@ -853,7 +854,8 @@ class _DesktopTransactionCardRowState
|
||||||
prefix = "";
|
prefix = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
final currentHeight = ref.watch(currentHeightProvider(coin).state).state;
|
final currentHeight = ref.watch(walletsChangeNotifierProvider
|
||||||
|
.select((value) => value.getManager(walletId).currentHeight));
|
||||||
|
|
||||||
return Material(
|
return Material(
|
||||||
color: Theme.of(context).extension<StackColors>()!.popupBG,
|
color: Theme.of(context).extension<StackColors>()!.popupBG,
|
||||||
|
|
|
@ -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/dialogs/cancelling_transaction_progress_dialog.dart';
|
||||||
import 'package:stackwallet/pages/wallet_view/transaction_views/edit_note_view.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/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/global/address_book_service_provider.dart';
|
||||||
import 'package:stackwallet/providers/providers.dart';
|
import 'package:stackwallet/providers/providers.dart';
|
||||||
import 'package:stackwallet/services/coins/epiccash/epiccash_wallet.dart';
|
import 'package:stackwallet/services/coins/epiccash/epiccash_wallet.dart';
|
||||||
|
@ -298,7 +297,8 @@ class _TransactionDetailsViewState
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
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(
|
return ConditionalParent(
|
||||||
condition: !isDesktop,
|
condition: !isDesktop,
|
||||||
|
|
|
@ -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<int, Coin>((ref, coin) => int64MaxValue);
|
|
|
@ -6,7 +6,6 @@ import 'package:stackwallet/models/isar/models/isar_models.dart';
|
||||||
import 'package:stackwallet/notifications/show_flush_bar.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/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_details_view.dart';
|
||||||
import 'package:stackwallet/providers/blockchain/dogecoin/current_height_provider.dart';
|
|
||||||
import 'package:stackwallet/providers/providers.dart';
|
import 'package:stackwallet/providers/providers.dart';
|
||||||
import 'package:stackwallet/utilities/constants.dart';
|
import 'package:stackwallet/utilities/constants.dart';
|
||||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||||
|
@ -121,7 +120,8 @@ class _TransactionCardState extends ConsumerState<TransactionCard> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final currentHeight = ref.watch(currentHeightProvider(coin).state).state;
|
final currentHeight = ref.watch(walletsChangeNotifierProvider
|
||||||
|
.select((value) => value.getManager(walletId).currentHeight));
|
||||||
|
|
||||||
return Material(
|
return Material(
|
||||||
color: Theme.of(context).extension<StackColors>()!.popupBG,
|
color: Theme.of(context).extension<StackColors>()!.popupBG,
|
||||||
|
|
Loading…
Reference in a new issue