2020-08-28 23:04:48 +03:00
|
|
|
import 'package:cake_wallet/src/screens/dashboard/widgets/filter_widget.dart';
|
2023-08-17 12:28:31 -03:00
|
|
|
import 'package:cake_wallet/themes/extensions/filter_theme.dart';
|
2020-09-25 18:32:44 +03:00
|
|
|
import 'package:cake_wallet/utils/show_pop_up.dart';
|
2020-07-23 15:20:52 +03:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:cake_wallet/generated/i18n.dart';
|
|
|
|
import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
|
2023-08-17 12:28:31 -03:00
|
|
|
import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
|
2020-07-23 15:20:52 +03:00
|
|
|
|
|
|
|
class HeaderRow extends StatelessWidget {
|
2022-10-12 13:09:57 -04:00
|
|
|
HeaderRow({required this.dashboardViewModel});
|
2020-07-23 15:20:52 +03:00
|
|
|
|
|
|
|
final DashboardViewModel dashboardViewModel;
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2020-08-19 20:57:06 +03:00
|
|
|
final filterIcon = Image.asset('assets/images/filter_icon.png',
|
2023-08-17 12:28:31 -03:00
|
|
|
color: Theme.of(context).extension<FilterTheme>()!.iconColor);
|
2020-08-19 20:57:06 +03:00
|
|
|
|
2020-07-23 15:20:52 +03:00
|
|
|
return Container(
|
|
|
|
height: 52,
|
|
|
|
color: Colors.transparent,
|
|
|
|
padding: EdgeInsets.only(left: 24, right: 24),
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: <Widget>[
|
|
|
|
Text(
|
|
|
|
S.of(context).transactions,
|
|
|
|
style: TextStyle(
|
2023-05-24 20:19:51 -03:00
|
|
|
fontSize: 20,
|
|
|
|
fontWeight: FontWeight.w500,
|
2023-08-17 12:28:31 -03:00
|
|
|
color: Theme.of(context).extension<DashboardPageTheme>()!.pageTitleTextColor),
|
2020-07-23 15:20:52 +03:00
|
|
|
),
|
2023-10-19 01:08:29 +03:00
|
|
|
Semantics(
|
|
|
|
container: true,
|
|
|
|
child: GestureDetector(
|
|
|
|
onTap: () {
|
|
|
|
showPopUp<void>(
|
|
|
|
context: context,
|
2024-06-06 04:51:22 +00:00
|
|
|
builder: (context) => FilterWidget(filterItems: dashboardViewModel.filterItems),
|
2023-10-19 01:08:29 +03:00
|
|
|
);
|
|
|
|
},
|
|
|
|
child: Semantics(
|
|
|
|
label: 'Transaction Filter',
|
|
|
|
button: true,
|
|
|
|
enabled: true,
|
|
|
|
child: Container(
|
|
|
|
height: 36,
|
|
|
|
width: 36,
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
shape: BoxShape.circle,
|
|
|
|
color: Theme.of(context).extension<FilterTheme>()!.buttonColor,
|
|
|
|
),
|
|
|
|
child: filterIcon,
|
|
|
|
),
|
|
|
|
),
|
2020-07-23 15:20:52 +03:00
|
|
|
),
|
2020-08-28 23:04:48 +03:00
|
|
|
)
|
2020-07-23 15:20:52 +03:00
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|