Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
material_floating_search_bar_2-0.5.0-f.3.0
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dart-package
material_floating_search_bar_2-0.5.0-f.3.0
Commits
62865899
Commit
62865899
authored
Mar 01, 2024
by
Rizal Hermawan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor : add custom functions inside FloatingSearchBarAction
parent
c724d3a1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
lib/src/floating_search_bar_actions.dart
+11
-0
No files found.
lib/src/floating_search_bar_actions.dart
View file @
62865899
...
...
@@ -20,6 +20,8 @@ class FloatingSearchBarAction extends StatelessWidget {
this
.
builder
,
this
.
showIfOpened
=
false
,
this
.
showIfClosed
=
true
,
this
.
runCustomFunction
=
false
,
this
.
customFunction
})
:
assert
(
builder
!=
null
||
child
!=
null
);
/// A hamburger menu that when tapped opens the [Drawer]
...
...
@@ -81,6 +83,8 @@ class FloatingSearchBarAction extends StatelessWidget {
Duration
duration
=
const
Duration
(
milliseconds:
900
),
String
searchButtonSemanticLabel
=
'Search'
,
String
clearButtonSemanticLabel
=
'Clear'
,
bool
runCustomFunction
=
false
,
void
Function
()?
customFunction
,
})
{
return
FloatingSearchBarAction
(
showIfOpened:
true
,
...
...
@@ -101,6 +105,9 @@ class FloatingSearchBarAction extends StatelessWidget {
onTap:
()
{
if
(!
isEmpty
)
{
bar
.
clear
();
if
(
runCustomFunction
==
true
)
{
customFunction
!;
}
}
else
{
bar
.
isOpen
=
!
bar
.
isOpen
||
(!
bar
.
hasFocus
&&
bar
.
isAlwaysOpened
);
...
...
@@ -196,6 +203,10 @@ class FloatingSearchBarAction extends StatelessWidget {
/// and when closed.
bool
get
isAlwaysShown
=>
showIfOpened
&&
showIfClosed
;
final
bool
runCustomFunction
;
final
void
Function
()?
customFunction
;
@override
Widget
build
(
BuildContext
context
)
{
return
child
??
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment