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