D1APP-38 clear filters button added
This commit is contained in:
parent
e75fdf0ee8
commit
253a6179de
|
|
@ -170,12 +170,10 @@ class _RadarState extends State<Radar> {
|
|||
data: ActionSheetData(
|
||||
title: 'فیلتر جستجو',
|
||||
titleIcon: DidvanIcons.filter_regular,
|
||||
hasDismissButton: false,
|
||||
dismissTitle: 'حذف فیلتر',
|
||||
confrimTitle: 'نمایش نتایج',
|
||||
onConfirmed: () {
|
||||
Navigator.of(context).pop();
|
||||
state.getRadarOverviews(page: 1, filter: true);
|
||||
},
|
||||
onDismissed: state.resetFilters,
|
||||
onConfirmed: () => state.getRadarOverviews(page: 1, filter: true),
|
||||
content: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ class RadarState extends CoreProvier {
|
|||
startDate = null;
|
||||
endDate = null;
|
||||
selectedCats.clear();
|
||||
getRadarOverviews(page: 1);
|
||||
}
|
||||
|
||||
Future<void> getRadarOverviews({
|
||||
|
|
|
|||
|
|
@ -109,6 +109,10 @@ class ActionSheetUtils {
|
|||
if (data.hasDismissButton)
|
||||
Expanded(
|
||||
child: DidvanButton(
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
data.onDismissed?.call();
|
||||
},
|
||||
title: data.dismissTitle ?? 'بازگشت',
|
||||
style: ButtonStyleMode.flat,
|
||||
),
|
||||
|
|
@ -117,7 +121,10 @@ class ActionSheetUtils {
|
|||
Expanded(
|
||||
child: DidvanButton(
|
||||
style: ButtonStyleMode.primary,
|
||||
onPressed: data.onConfirmed,
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
data.onConfirmed?.call();
|
||||
},
|
||||
title: data.confrimTitle ?? 'تایید',
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import 'package:didvan/config/design_config.dart';
|
||||
import 'package:didvan/config/theme_data.dart';
|
||||
import 'package:didvan/models/enums.dart';
|
||||
import 'package:didvan/widgets/didvan/text.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
|
@ -23,7 +24,9 @@ class DidvanButton extends StatelessWidget {
|
|||
borderRadius: DesignConfig.lowBorderRadius,
|
||||
),
|
||||
height: 48,
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
color: style == ButtonStyleMode.primary
|
||||
? Theme.of(context).colorScheme.primary
|
||||
: Theme.of(context).colorScheme.secondCTA,
|
||||
onPressed: () {
|
||||
FocusScope.of(context).unfocus();
|
||||
onPressed?.call();
|
||||
|
|
|
|||
Loading…
Reference in New Issue