dev
dart 49 lines 1.37 KB
Raw
1 import "package:cake_wallet/src/widgets/cake_image_widget.dart";
2 import "package:cw_core/currency_for_wallet_type.dart";
3 import "package:flutter/material.dart";
4
5 class SwapSectionHeader extends StatelessWidget {
6 const SwapSectionHeader({
7 required this.label,
8 required this.networkName,
9 required this.networkIconPath,
10 });
11
12 final String label;
13 final String networkName;
14 final String networkIconPath;
15
16 @override
17 Widget build(BuildContext context) {
18 final colors = Theme.of(context).colorScheme;
19 final textTheme = Theme.of(context).textTheme;
20 return Padding(
21 padding: const EdgeInsets.symmetric(horizontal: 16),
22 child: Row(
23 children: [
24 Text(
25 label,
26 style:
27 textTheme.bodyMedium?.copyWith(fontWeight: FontWeight.w500, letterSpacing: -0.07),
28 ),
29 const SizedBox(width: 8),
30 CakeImageWidget(
31 imageUrl: networkIconPath,
32 width: 16,
33 height: 16,
34 color: isMonochromeSymbolIcon(networkIconPath) ? colors.primary : null,
35 ),
36 const SizedBox(width: 4),
37 Text(
38 networkName,
39 style: textTheme.bodyMedium?.copyWith(
40 fontWeight: FontWeight.w500,
41 letterSpacing: -0.07,
42 color: colors.primary,
43 ),
44 ),
45 ],
46 ),
47 );
48 }
49 }