11import 'package:flutter/material.dart' ;
22import 'package:flutter_riverpod/flutter_riverpod.dart' ;
3+ import 'package:go_router/go_router.dart' ;
34
45import 'package:bdk_demo/core/theme/app_theme.dart' ;
56import 'package:bdk_demo/core/utils/formatters.dart' ;
@@ -95,6 +96,13 @@ class _ActiveWalletsPageState extends ConsumerState<ActiveWalletsPage> {
9596 return '${descriptor .substring (0 , 24 )}...${descriptor .substring (descriptor .length - 18 )}' ;
9697 }
9798
99+ void _openTransactionDetail (TxDetails transaction) {
100+ context.pushNamed (
101+ 'transactionDetail' ,
102+ pathParameters: {'txid' : transaction.txid},
103+ );
104+ }
105+
98106 @override
99107 Widget build (BuildContext context) {
100108 final theme = Theme .of (context);
@@ -289,7 +297,11 @@ class _ActiveWalletsPageState extends ConsumerState<ActiveWalletsPage> {
289297 index < _transactions.length;
290298 index++
291299 ) ...[
292- _TransactionRow (transaction: _transactions[index]),
300+ _TransactionRow (
301+ transaction: _transactions[index],
302+ onTap: () =>
303+ _openTransactionDetail (_transactions[index]),
304+ ),
293305 if (index < _transactions.length - 1 )
294306 const SizedBox (height: 12 ),
295307 ],
@@ -464,8 +476,9 @@ class _DetailRow extends StatelessWidget {
464476
465477class _TransactionRow extends StatelessWidget {
466478 final TxDetails transaction;
479+ final VoidCallback onTap;
467480
468- const _TransactionRow ({required this .transaction});
481+ const _TransactionRow ({required this .transaction, required this .onTap });
469482
470483 @override
471484 Widget build (BuildContext context) {
@@ -485,46 +498,54 @@ class _TransactionRow extends StatelessWidget {
485498 ? 'Confirmed'
486499 : 'Block ${transaction .blockHeight }' ;
487500
488- return Container (
489- width: double .infinity,
490- padding: const EdgeInsets .all (16 ),
491- decoration: BoxDecoration (
501+ return Material (
502+ color: Colors .transparent,
503+ child: InkWell (
492504 borderRadius: BorderRadius .circular (16 ),
493- border: Border .all (color: theme.colorScheme.outlineVariant),
494- ),
495- child: Column (
496- crossAxisAlignment: CrossAxisAlignment .start,
497- children: [
498- Row (
505+ onTap: onTap,
506+ child: Ink (
507+ width: double .infinity,
508+ padding: const EdgeInsets .all (16 ),
509+ decoration: BoxDecoration (
510+ borderRadius: BorderRadius .circular (16 ),
511+ border: Border .all (color: theme.colorScheme.outlineVariant),
512+ ),
513+ child: Column (
514+ crossAxisAlignment: CrossAxisAlignment .start,
499515 children: [
500- Expanded (
501- child: Text (
502- amountLabel,
503- style: theme.textTheme.titleMedium? .copyWith (
504- fontWeight: FontWeight .w700,
505- color: accentColor,
516+ Row (
517+ children: [
518+ Expanded (
519+ child: Text (
520+ amountLabel,
521+ style: theme.textTheme.titleMedium? .copyWith (
522+ fontWeight: FontWeight .w700,
523+ color: accentColor,
524+ ),
525+ ),
506526 ),
527+ const SizedBox (width: 12 ),
528+ _StatusChip (status: transaction.statusLabel),
529+ ],
530+ ),
531+ const SizedBox (height: 8 ),
532+ Text (
533+ transaction.shortTxid,
534+ style: AppTheme .monoStyle.copyWith (
535+ fontSize: 13 ,
536+ color: theme.colorScheme.onSurface,
537+ ),
538+ ),
539+ const SizedBox (height: 4 ),
540+ Text (
541+ subtitle,
542+ style: theme.textTheme.bodySmall? .copyWith (
543+ color: theme.colorScheme.onSurface.withAlpha (170 ),
507544 ),
508545 ),
509- _StatusChip (status: transaction.statusLabel),
510546 ],
511547 ),
512- const SizedBox (height: 8 ),
513- Text (
514- transaction.shortTxid,
515- style: AppTheme .monoStyle.copyWith (
516- fontSize: 13 ,
517- color: theme.colorScheme.onSurface,
518- ),
519- ),
520- const SizedBox (height: 4 ),
521- Text (
522- subtitle,
523- style: theme.textTheme.bodySmall? .copyWith (
524- color: theme.colorScheme.onSurface.withAlpha (170 ),
525- ),
526- ),
527- ],
548+ ),
528549 ),
529550 );
530551 }
0 commit comments