| 1 | import 'package:cake_wallet/src/widgets/cake_image_widget.dart'; |
| 2 | import 'package:flutter/material.dart'; |
| 3 | import 'package:flutter_svg/svg.dart'; |
| 4 | |
| 5 | class DropdownRow extends StatelessWidget { |
| 6 | const DropdownRow({super.key, required this.expanded, required this.text, required this.onTap}); |
| 7 | |
| 8 | final bool expanded; |
| 9 | final VoidCallback onTap; |
| 10 | final String text; |
| 11 | |
| 12 | @override |
| 13 | Widget build(BuildContext context) { |
| 14 | return Semantics( |
| 15 | button: true, |
| 16 | expanded: expanded, |
| 17 | label: text, |
| 18 | onTap: onTap, |
| 19 | excludeSemantics: true, |
| 20 | child: Container( |
| 21 | decoration: BoxDecoration( |
| 22 | color: Theme.of(context).colorScheme.surfaceContainer, |
| 23 | borderRadius: BorderRadius.vertical( |
| 24 | top: Radius.circular(18), |
| 25 | bottom: expanded ? Radius.zero : Radius.circular(18), |
| 26 | ), |
| 27 | ), |
| 28 | height: 48, |
| 29 | child: Material( |
| 30 | color: Colors.transparent, |
| 31 | child: InkWell( |
| 32 | onTap: onTap, |
| 33 | child: Padding( |
| 34 | padding: const EdgeInsets.symmetric(horizontal: 16.0), |
| 35 | child: Row( |
| 36 | mainAxisAlignment: MainAxisAlignment.spaceBetween, |
| 37 | children: [ |
| 38 | Text( |
| 39 | text, |
| 40 | style: TextStyle(fontSize: 14, color: Theme.of(context).colorScheme.primary), |
| 41 | ), |
| 42 | AnimatedRotation( |
| 43 | duration: Duration(milliseconds: 300), |
| 44 | turns: expanded ? 0.0 : 0.5, |
| 45 | curve: Curves.easeOut, |
| 46 | child: CakeImageWidget( |
| 47 | imageUrl: "assets/new-ui/dropdown_arrow.svg", |
| 48 | colorFilter: ColorFilter.mode( |
| 49 | Theme.of(context).colorScheme.primary, BlendMode.srcIn), |
| 50 | )) |
| 51 | ], |
| 52 | ), |
| 53 | ), |
| 54 | ), |
| 55 | ), |
| 56 | ), |
| 57 | ); |
| 58 | } |
| 59 | } |