feat: load real transaction history in demo app#102
Conversation
…tate and native resource disposal
…from widget tests
|
Hi @j-kon, nice work here I noticed something. The Steps to reproduce: load wallet A → open Transactions → Load Transaction History → switch to wallet B → reopen Transactions. It still shows wallet A's transactions; tapping one resolves against B's repository and 404s as "Transaction not found." The sibling providers already handle this by keying off wallet identity, blockchain_providers.dart resets when activeWalletRecordProvider.id changes. Might be worth having the controller watch an activeWalletId (or ref.listen the record and reset) instead of a bool. Happy to be corrected if in-place switching isn't a supported flow. |
|
Thanks for the detailed. You were right that the transaction state was scoped only to wallet availability rather than the logical active wallet. I updated the transaction list and detail flow to use the active wallet record ID. Switching from wallet A to wallet B now clears the previous wallet’s transaction state, and stale asynchronous results are ignored if the active wallet changes before loading completes. I also added coverage for wallet switching so transaction list and detail data cannot leak between active wallets. |
|
Thanks @j-kon |
| @override | ||
| TransactionsState build() => const TransactionsState.idle(); | ||
| TransactionsState build() { | ||
| final activeWalletId = ref.watch(activeWalletIdProvider); |
There was a problem hiding this comment.
tNACK e4c458c
Navigating to Transaction History on device throws:
setState() or markNeedsBuild() called during build. UncontrolledProviderScope … already building widget currently being built: TransactionsListPage
pls fix the rebuild + listen pattern, and add a widget coverage that mounts the list page with an active wallet so this can’t fail silently.
Summary
Context
Continues the transaction presentation scaffold from #62 by wiring the list/detail flow to active wallet transaction data instead of sample rows.
The production transaction repository still uses the BDK Dart API to read wallet transactions, while widget tests use fake repositories and a lightweight wallet-availability provider.
Verification
dart format --output=none --set-exit-if-changed lib test example bdk_demo/lib bdk_demo/testdart analyze --fatal-infos --fatal-warnings lib test exampledart testflutter analyzeinsidebdk_demoflutter test --no-pub testinsidebdk_demoValidation passed:
Also confirmed:
transactions_list_page_test.dartdoes not importpackage:bdk_dart/bdk.dartWallettransactions_repository.dartstill imports and uses BDK