Commit 171bb6b4 by Rizal Hermawan

refactor : add clearFilter Function

parent c93c03d5
...@@ -77,6 +77,7 @@ class FloatingSearchBarAction extends StatelessWidget { ...@@ -77,6 +77,7 @@ class FloatingSearchBarAction extends StatelessWidget {
factory FloatingSearchBarAction.searchToClear({ factory FloatingSearchBarAction.searchToClear({
double size = 24, double size = 24,
Color? color, Color? color,
Function()? clearFilter,
bool showIfClosed = true, bool showIfClosed = true,
Duration duration = const Duration(milliseconds: 900), Duration duration = const Duration(milliseconds: 900),
String searchButtonSemanticLabel = 'Search', String searchButtonSemanticLabel = 'Search',
...@@ -105,6 +106,7 @@ class FloatingSearchBarAction extends StatelessWidget { ...@@ -105,6 +106,7 @@ class FloatingSearchBarAction extends StatelessWidget {
bar.isOpen = bar.isOpen =
!bar.isOpen || (!bar.hasFocus && bar.isAlwaysOpened); !bar.isOpen || (!bar.hasFocus && bar.isAlwaysOpened);
} }
clearFilter!();
}, },
searchButtonSemanticLabel: searchButtonSemanticLabel, searchButtonSemanticLabel: searchButtonSemanticLabel,
clearButtonSemanticLabel: clearButtonSemanticLabel, clearButtonSemanticLabel: clearButtonSemanticLabel,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment