Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added missing parameter filterWidgetBuilder #124

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading