dev
dart 74 lines 2.26 KB
Raw
1 import 'package:flutter/material.dart';
2
3 class AnonpayTransactionRow extends StatelessWidget {
4 AnonpayTransactionRow({
5 required this.provider,
6 required this.createdAt,
7 required this.currency,
8 required this.onTap,
9 required this.amount,
10 super.key,
11 });
12
13 final VoidCallback? onTap;
14 final String provider;
15 final String createdAt;
16 final String amount;
17 final String currency;
18
19 @override
20 Widget build(BuildContext context) {
21 return InkWell(
22 onTap: onTap,
23 child: Container(
24 padding: EdgeInsets.fromLTRB(24, 8, 24, 8),
25 color: Colors.transparent,
26 child: Row(
27 mainAxisSize: MainAxisSize.max,
28 crossAxisAlignment: CrossAxisAlignment.center,
29 children: [
30 _getImage(),
31 SizedBox(width: 12),
32 Expanded(
33 child: Column(
34 mainAxisSize: MainAxisSize.min,
35 children: [
36 Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: <Widget>[
37 Text(
38 provider,
39 style: Theme.of(context).textTheme.bodyMedium?.copyWith(
40 fontWeight: FontWeight.w500,
41 ),
42 ),
43 Text(
44 amount + ' ' + currency,
45 style: Theme.of(context).textTheme.bodyMedium?.copyWith(
46 fontWeight: FontWeight.w500,
47 ),
48 ),
49 ]),
50 SizedBox(height: 5),
51 Row(
52 mainAxisAlignment: MainAxisAlignment.spaceBetween,
53 children: <Widget>[
54 Text(
55 createdAt,
56 style: Theme.of(context).textTheme.bodySmall?.copyWith(
57 color: Theme.of(context).colorScheme.onSurfaceVariant,
58 ),
59 ),
60 ],
61 )
62 ],
63 ),
64 )
65 ],
66 ),
67 ),
68 );
69 }
70
71 Widget _getImage() => ClipRRect(
72 borderRadius: BorderRadius.circular(50),
73 child: Image.asset('assets/images/trocador.png', width: 36, height: 36));
74 }