| 1 | import 'package:cake_wallet/themes/core/theme_extension.dart'; |
| 2 | import 'package:flutter/material.dart'; |
| 3 | |
| 4 | class ManufacturerOptionTile extends StatelessWidget { |
| 5 | const ManufacturerOptionTile({ |
| 6 | required this.onPressed, |
| 7 | required this.image, |
| 8 | this.tag, |
| 9 | this.isUnavailable = false, |
| 10 | }); |
| 11 | |
| 12 | final VoidCallback onPressed; |
| 13 | final Widget image; |
| 14 | final String? tag; |
| 15 | final bool isUnavailable; |
| 16 | |
| 17 | @override |
| 18 | Widget build(BuildContext context) => GestureDetector( |
| 19 | onTap: onPressed, |
| 20 | child: Opacity( |
| 21 | opacity: isUnavailable ? 0.5 : 1, |
| 22 | child: Container( |
| 23 | width: double.infinity, |
| 24 | alignment: Alignment.center, |
| 25 | decoration: BoxDecoration( |
| 26 | borderRadius: BorderRadius.circular(12), |
| 27 | gradient: LinearGradient( |
| 28 | colors: [ |
| 29 | context.customColors.cardGradientColorPrimary, |
| 30 | context.customColors.cardGradientColorSecondary, |
| 31 | ], |
| 32 | begin: Alignment.topCenter, |
| 33 | end: Alignment.bottomCenter, |
| 34 | ), |
| 35 | ), |
| 36 | padding: EdgeInsets.all(24), |
| 37 | child: Row( |
| 38 | mainAxisSize: MainAxisSize.max, |
| 39 | mainAxisAlignment: MainAxisAlignment.center, |
| 40 | children: <Widget>[ |
| 41 | Expanded( |
| 42 | child: Column( |
| 43 | mainAxisSize: MainAxisSize.max, |
| 44 | mainAxisAlignment: MainAxisAlignment.start, |
| 45 | crossAxisAlignment: CrossAxisAlignment.start, |
| 46 | children: <Widget>[ |
| 47 | Row( |
| 48 | children: [ |
| 49 | Container(height: 25, child: image), |
| 50 | if (tag != null) |
| 51 | Container( |
| 52 | decoration: BoxDecoration( |
| 53 | border: Border.all(color: Colors.transparent), |
| 54 | borderRadius: BorderRadius.circular(20), |
| 55 | color: Theme.of(context).colorScheme.surfaceContainerLow), |
| 56 | padding: EdgeInsets.symmetric(horizontal: 5), |
| 57 | margin: EdgeInsets.only(left: 5), |
| 58 | child: Text(tag!)) |
| 59 | ], |
| 60 | ), |
| 61 | ], |
| 62 | ), |
| 63 | ), |
| 64 | Icon( |
| 65 | Icons.arrow_forward_ios, |
| 66 | size: 16, |
| 67 | color: Theme.of(context).colorScheme.onSurface, |
| 68 | ) |
| 69 | ], |
| 70 | ), |
| 71 | ), |
| 72 | ), |
| 73 | ); |
| 74 | } |