| 1 | import 'package:cake_wallet/src/screens/dashboard/widgets/filter_widget.dart'; |
| 2 | import 'package:cake_wallet/utils/show_pop_up.dart'; |
| 3 | import 'package:flutter/material.dart'; |
| 4 | import 'package:cake_wallet/generated/i18n.dart'; |
| 5 | import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart'; |
| 6 | |
| 7 | class HeaderRow extends StatelessWidget { |
| 8 | HeaderRow({required this.dashboardViewModel, this.onExportCsv, super.key}); |
| 9 | |
| 10 | final DashboardViewModel dashboardViewModel; |
| 11 | final VoidCallback? onExportCsv; |
| 12 | |
| 13 | @override |
| 14 | Widget build(BuildContext context) { |
| 15 | final filterIcon = Image.asset('assets/images/filter_icon.png', |
| 16 | color: Theme.of(context).colorScheme.onSurface); |
| 17 | |
| 18 | return Container( |
| 19 | height: 52, |
| 20 | color: Colors.transparent, |
| 21 | padding: EdgeInsets.only(left: 24, right: 24), |
| 22 | child: Row( |
| 23 | mainAxisAlignment: MainAxisAlignment.spaceBetween, |
| 24 | crossAxisAlignment: CrossAxisAlignment.center, |
| 25 | children: <Widget>[ |
| 26 | Text( |
| 27 | S.of(context).history, |
| 28 | style: Theme.of(context).textTheme.titleLarge?.copyWith( |
| 29 | fontWeight: FontWeight.w500, color: Theme.of(context).colorScheme.onSurface), |
| 30 | ), |
| 31 | Row( |
| 32 | children: [ |
| 33 | if (onExportCsv != null) |
| 34 | Padding( |
| 35 | padding: const EdgeInsets.only(right: 8), |
| 36 | child: GestureDetector( |
| 37 | key: ValueKey('transactions_page_header_row_export_csv_button_key'), |
| 38 | onTap: onExportCsv, |
| 39 | child: Semantics( |
| 40 | label: S.of(context).export_csv, |
| 41 | button: true, |
| 42 | enabled: true, |
| 43 | child: Container( |
| 44 | height: 36, |
| 45 | width: 36, |
| 46 | decoration: BoxDecoration( |
| 47 | shape: BoxShape.circle, |
| 48 | color: Theme.of(context).colorScheme.surfaceContainer, |
| 49 | ), |
| 50 | child: Icon( |
| 51 | Icons.file_download_outlined, |
| 52 | color: Theme.of(context).colorScheme.onSurface, |
| 53 | size: 20, |
| 54 | ), |
| 55 | ), |
| 56 | ), |
| 57 | ), |
| 58 | ), |
| 59 | Semantics( |
| 60 | container: true, |
| 61 | child: GestureDetector( |
| 62 | key: ValueKey('transactions_page_header_row_transaction_filter_button_key'), |
| 63 | onTap: () {}, |
| 64 | child: Semantics( |
| 65 | label: 'Transaction Filter', |
| 66 | button: true, |
| 67 | enabled: true, |
| 68 | child: Container( |
| 69 | height: 36, |
| 70 | width: 36, |
| 71 | decoration: BoxDecoration( |
| 72 | shape: BoxShape.circle, |
| 73 | color: Theme.of(context).colorScheme.surfaceContainer, |
| 74 | ), |
| 75 | child: filterIcon, |
| 76 | ), |
| 77 | ), |
| 78 | ), |
| 79 | ), |
| 80 | ], |
| 81 | ) |
| 82 | ], |
| 83 | ), |
| 84 | ); |
| 85 | } |
| 86 | } |