| 1 | import 'package:cake_wallet/src/widgets/cake_image_widget.dart'; |
| 2 | import 'package:flutter/material.dart'; |
| 3 | import 'package:flutter_svg/flutter_svg.dart'; |
| 4 | |
| 5 | class ReceiveLabelWidget extends StatelessWidget { |
| 6 | const ReceiveLabelWidget({super.key, required this.name, required this.largeQrMode}); |
| 7 | |
| 8 | final String name; |
| 9 | final bool largeQrMode; |
| 10 | |
| 11 | @override |
| 12 | Widget build(BuildContext context) { |
| 13 | return AnimatedContainer( |
| 14 | duration: Duration(milliseconds: 200), |
| 15 | height: largeQrMode || name.isEmpty ? 0 : 36, |
| 16 | decoration: BoxDecoration( |
| 17 | color: Theme.of(context).colorScheme.surfaceContainer, |
| 18 | borderRadius: BorderRadius.circular(999)), |
| 19 | child: Padding( |
| 20 | padding: const EdgeInsets.symmetric(horizontal: 10.0), |
| 21 | child: Row( |
| 22 | spacing: 8, |
| 23 | mainAxisSize: MainAxisSize.min, |
| 24 | children: [ |
| 25 | ExcludeSemantics( |
| 26 | child: ClipRect( |
| 27 | child: CakeImageWidget( |
| 28 | imageUrl: "assets/new-ui/label.svg", |
| 29 | width: 24, |
| 30 | height: 24, |
| 31 | colorFilter: ColorFilter.mode( |
| 32 | Theme.of(context).colorScheme.onSurfaceVariant, BlendMode.srcIn), |
| 33 | )), |
| 34 | ), |
| 35 | Text(name, |
| 36 | style: TextStyle( |
| 37 | fontSize: 12, color: Theme.of(context).colorScheme.onSurfaceVariant)), |
| 38 | ], |
| 39 | ), |
| 40 | )); |
| 41 | } |
| 42 | } |