From 3e77fb1707fe504f2d913eeda7dc8b79a52e262a Mon Sep 17 00:00:00 2001 From: nextwo <1234> Date: Wed, 15 Nov 2023 16:58:28 +0300 Subject: [PATCH] When we have filters, add reset button. --- lib/l10n/app_ar.arb | 3 +- lib/l10n/app_en.arb | 3 +- .../my_request/all_requests_filter_page.dart | 34 ++++++++++++++++++- 3 files changed, 37 insertions(+), 3 deletions(-) diff --git a/lib/l10n/app_ar.arb b/lib/l10n/app_ar.arb index e7c6540e..d894cf50 100644 --- a/lib/l10n/app_ar.arb +++ b/lib/l10n/app_ar.arb @@ -367,5 +367,6 @@ "createSubWorkOrder" : "إنشاء أمر عمل فرعي", "mrNumber" : "MR Number", "vendorEng" : "المهندس المزود", - "vendorName" : "اسم المزود" + "vendorName" : "اسم المزود", + "reset" : "اعادة تعيين" } \ No newline at end of file diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index 0e2d06f4..310af1b1 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -370,5 +370,6 @@ "createSubWorkOrder" : "Create Sub Work Order", "mrNumber" : "MR Number", "vendorEng" : "Vendor Engineer", - "vendorName" : "Vendor Name" + "vendorName" : "Vendor Name", + "reset" : "Reset" } \ No newline at end of file diff --git a/lib/new_views/pages/land_page/my_request/all_requests_filter_page.dart b/lib/new_views/pages/land_page/my_request/all_requests_filter_page.dart index 31cf51b2..8dcef36e 100644 --- a/lib/new_views/pages/land_page/my_request/all_requests_filter_page.dart +++ b/lib/new_views/pages/land_page/my_request/all_requests_filter_page.dart @@ -10,6 +10,7 @@ import 'package:test_sa/new_views/pages/land_page/widgets/static_filter_buttons. import 'package:test_sa/views/widgets/date_and_time/date_picker.dart'; import '../../../../controllers/providers/api/all_requests_provider.dart'; +import '../../../app_style/app_color.dart'; import '../../../common_widgets/app_lazy_loading.dart'; import '../../../common_widgets/default_app_bar.dart'; @@ -56,7 +57,38 @@ class _AllRequestsFilterPageState extends State { search.searchBySelectedValue = search.requestNumber; } return Scaffold( - appBar: DefaultAppBar(title: context.translation.filter), + appBar: AppBar( + automaticallyImplyLeading: false, + titleSpacing: 16, + title: Row( + children: [ + const Icon(Icons.arrow_back_ios).onPress(() { + Navigator.of(context).pop(); + }), + Text( + context.translation.filter, + style: AppTextStyles.heading3?.copyWith(fontWeight: FontWeight.w600, color: context.isDark ? AppColor.neutral30 : AppColor.neutral50), + ).expanded, + ], + ), + actions: [ + Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text(context.translation.reset, + style: AppTextStyles.bodyText2.copyWith(color: const Color(0xFF4A8DB7)), + ).paddingAll(8).onPress(() { + setState(() { + search.statuses.clear(); + search.typeTransaction.clear(); + search.startDate=null; + search.endDate = null; + }); + }), + ], + ) + ], + ), body: Column( children: [ SingleChildScrollView(