Skip to content

Commit

Permalink
Added missing parameter filterWidgetBuilder and onFilterSuffixTap
Browse files Browse the repository at this point in the history
  • Loading branch information
stan-at-work committed Dec 17, 2024
1 parent 894ede9 commit bca1bb3
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
11 changes: 11 additions & 0 deletions lib/src/model/pluto_column.dart
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,15 @@ class PlutoColumn {
///Set suffix icon for filter field
Icon? filterSuffixIcon;

/// Set a custom on tap event for the filter suffix icon
Function(
FocusNode focusNode,
TextEditingController controller,
bool enabled,
void Function(String changed) handleOnChanged,
PlutoGridStateManager stateManager,
)? onFilterSuffixTap;

///Set custom widget
@Deprecated("Use new filterWidgetBuilder to provide some parameters")
Widget? filterWidget;
Expand Down Expand Up @@ -257,6 +266,8 @@ class PlutoColumn {
this.filterSuffixIcon,
@Deprecated("Use new filterWidgetBuilder to provide some parameters")
this.filterWidget,
this.filterWidgetBuilder,
this.onFilterSuffixTap,
this.enableHideColumnMenuItem = true,
this.enableSetColumnsMenuItem = true,
this.enableAutoEditing = false,
Expand Down
15 changes: 14 additions & 1 deletion lib/src/ui/columns/pluto_column_filter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,20 @@ class PlutoColumnFilterState extends PlutoStateWithChange<PlutoColumnFilter> {
onChanged: _handleOnChanged,
onEditingComplete: _handleOnEditingComplete,
decoration: InputDecoration(
suffixIcon: widget.column.filterSuffixIcon,
suffixIcon: widget.column.filterSuffixIcon != null
? GestureDetector(
onTap: () {
widget.column.onFilterSuffixTap?.call(
_focusNode,
_controller,
_enabled,
_handleOnChanged,
stateManager,
);
},
child: widget.column.filterSuffixIcon,
)
: null,
hintText: widget.column.filterHintText ??
(_enabled ? widget.column.defaultFilter.title : ''),
filled: true,
Expand Down

0 comments on commit bca1bb3

Please sign in to comment.