dev
dart 81 lines 2.8 KB
Raw
1 import 'package:cake_wallet/entities/wallet_nft_response.dart';
2 import 'package:cake_wallet/routes.dart';
3 import 'package:cake_wallet/src/screens/dashboard/pages/nft_details_page.dart';
4 import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
5 import 'package:flutter/material.dart';
6
7 class NFTTileWidget extends StatelessWidget {
8 const NFTTileWidget({super.key, required this.nftAsset});
9
10 final NFTAssetModel nftAsset;
11 @override
12 Widget build(BuildContext context) {
13 return InkWell(
14 onTap: () => Navigator.pushNamed(
15 context,
16 Routes.nftDetailsPage,
17 arguments: NFTDetailsPageArguments(
18 isSolanaNFT: false,
19 nftAsset: nftAsset,
20 ),
21 ),
22 child: Container(
23 width: double.infinity,
24 margin: const EdgeInsets.only(left: 16, right: 16),
25 decoration: BoxDecoration(
26 borderRadius: BorderRadius.circular(30.0),
27 border: Border.all(
28 color: Theme.of(context).colorScheme.outline,
29 width: 0.0,
30 ),
31 color: Theme.of(context).colorScheme.surfaceContainer,
32 ),
33 child: Row(
34 children: [
35 Container(
36 height: 100,
37 width: 100,
38 clipBehavior: Clip.hardEdge,
39 margin: const EdgeInsets.all(8),
40 decoration: BoxDecoration(
41 borderRadius: BorderRadius.circular(24.0),
42 border: Border.all(
43 color: Theme.of(context).colorScheme.outline,
44 width: 0.0,
45 ),
46 color: Theme.of(context).colorScheme.surface,
47 ),
48 child: CakeImageWidget(
49 imageUrl: nftAsset.normalizedMetadata?.imageUrl,
50 ),
51 ),
52 Expanded(
53 child: Column(
54 mainAxisAlignment: MainAxisAlignment.center,
55 crossAxisAlignment: CrossAxisAlignment.start,
56 children: [
57 Text(
58 '${nftAsset.name ?? '---'} - ${nftAsset.symbol ?? '---'}',
59 style: Theme.of(context).textTheme.bodySmall?.copyWith(
60 color: Theme.of(context).colorScheme.onSurfaceVariant,
61 height: 1,
62 ),
63 ),
64 SizedBox(height: 8),
65 Text(
66 nftAsset.normalizedMetadata?.name ?? nftAsset.name ?? "---",
67 style: Theme.of(context).textTheme.titleLarge?.copyWith(
68 fontWeight: FontWeight.w900,
69 color: Theme.of(context).colorScheme.onSurface,
70 height: 1,
71 ),
72 ),
73 ],
74 ),
75 )
76 ],
77 ),
78 ),
79 );
80 }
81 }