From cb9f135951b4bddf052fc4cc1af1f024a9198c22 Mon Sep 17 00:00:00 2001 From: ahmedhanafy725 Date: Sat, 9 Mar 2024 19:05:11 +0200 Subject: [PATCH] Update wallet card to use the wallet screen --- app/lib/widgets/wallet_card.dart | 93 +++++++++++++++++++------------- 1 file changed, 56 insertions(+), 37 deletions(-) diff --git a/app/lib/widgets/wallet_card.dart b/app/lib/widgets/wallet_card.dart index ec5ed0dc..eba1802c 100644 --- a/app/lib/widgets/wallet_card.dart +++ b/app/lib/widgets/wallet_card.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:threebotlogin/models/wallet.dart'; +import 'package:threebotlogin/screens/wallet_details.dart'; class WalletCardWidget extends StatelessWidget { const WalletCardWidget({super.key, required this.wallet}); @@ -8,51 +9,69 @@ class WalletCardWidget extends StatelessWidget { @override Widget build(BuildContext context) { return Card( - child: Padding( - padding: const EdgeInsets.all(16), - child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - wallet.name, - style: Theme.of(context).textTheme.titleLarge!.copyWith( - color: Theme.of(context).colorScheme.onSecondaryContainer, - ), - ), - const SizedBox(height: 10), - Row( + child: InkWell( + onTap: () { + Navigator.of(context).push(MaterialPageRoute( + builder: (context) => WalletDetailsScreen(wallet: wallet), + )); + }, + child: Padding( + padding: const EdgeInsets.all(16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - 'Stellar', - style: Theme.of(context).textTheme.bodyLarge!.copyWith( + wallet.name, + style: Theme.of(context).textTheme.titleLarge!.copyWith( color: Theme.of(context).colorScheme.onSecondaryContainer, ), ), - const Spacer(), - Text( - '${wallet.stellarBalance} TFT', - style: Theme.of(context).textTheme.bodyLarge!.copyWith( - color: Theme.of(context).colorScheme.onSecondaryContainer, - ), + const SizedBox(height: 10), + Row( + children: [ + Text( + 'Stellar', + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + color: Theme.of(context) + .colorScheme + .onSecondaryContainer, + ), + ), + const Spacer(), + Text( + '${wallet.stellarBalance} TFT', + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + color: Theme.of(context) + .colorScheme + .onSecondaryContainer, + ), + ), + ], ), + Row( + children: [ + Text( + 'TFChain', + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + color: Theme.of(context) + .colorScheme + .onSecondaryContainer, + ), + ), + const Spacer(), + Text( + '${wallet.tfchainBalance} TFT', + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + color: Theme.of(context) + .colorScheme + .onSecondaryContainer, + ), + ), + ], + ) ], ), - Row( - children: [ - Text( - 'TFChain', - style: Theme.of(context).textTheme.bodyLarge!.copyWith( - color: Theme.of(context).colorScheme.onSecondaryContainer, - ), - ), - const Spacer(), - Text( - '${wallet.tfchainBalance} TFT', - style: Theme.of(context).textTheme.bodyLarge!.copyWith( - color: Theme.of(context).colorScheme.onSecondaryContainer, - ), - ), - ], - ) - ]), + ), ), ); }