Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
material_floating_search_bar_2-0.5.0-edited
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-edited
Commits
b9a51039
Commit
b9a51039
authored
Feb 13, 2024
by
Rizal Hermawan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor : add a property so that textinput search does not automatically disappear
parent
fd8cad15
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletions
+14
-1
lib/src/floating_search_app_bar.dart
+10
-1
lib/src/floating_search_bar.dart
+4
-0
No files found.
lib/src/floating_search_app_bar.dart
View file @
b9a51039
...
@@ -54,6 +54,7 @@ class FloatingSearchAppBar extends ImplicitlyAnimatedWidget {
...
@@ -54,6 +54,7 @@ class FloatingSearchAppBar extends ImplicitlyAnimatedWidget {
this
.
autocorrect
=
true
,
this
.
autocorrect
=
true
,
this
.
contextMenuBuilder
,
this
.
contextMenuBuilder
,
this
.
onKeyEvent
,
this
.
onKeyEvent
,
this
.
autoRemoveControllerValue
})
:
assert
(
progress
==
null
||
(
progress
is
num
||
progress
is
bool
)),
})
:
assert
(
progress
==
null
||
(
progress
is
num
||
progress
is
bool
)),
super
(
key
,
implicitDuration
,
implicitCurve
);
super
(
key
,
implicitDuration
,
implicitCurve
);
...
@@ -191,6 +192,8 @@ class FloatingSearchAppBar extends ImplicitlyAnimatedWidget {
...
@@ -191,6 +192,8 @@ class FloatingSearchAppBar extends ImplicitlyAnimatedWidget {
return
context
.
findAncestorStateOfType
<
FloatingSearchAppBarState
>();
return
context
.
findAncestorStateOfType
<
FloatingSearchAppBarState
>();
}
}
final
bool
?
autoRemoveControllerValue
;
@override
@override
FloatingSearchAppBarState
createState
()
=>
FloatingSearchAppBarState
();
FloatingSearchAppBarState
createState
()
=>
FloatingSearchAppBarState
();
}
}
...
@@ -209,7 +212,13 @@ class FloatingSearchAppBarState extends ImplicitlyAnimatedWidgetState<
...
@@ -209,7 +212,13 @@ class FloatingSearchAppBarState extends ImplicitlyAnimatedWidgetState<
if
(
status
==
AnimationStatus
.
dismissed
)
{
if
(
status
==
AnimationStatus
.
dismissed
)
{
if
(
widget
.
clearQueryOnClose
)
{
if
(
widget
.
clearQueryOnClose
)
{
clear
();
if
(
widget
.
autoRemoveControllerValue
==
null
)
{
clear
();
}
else
{
if
(
widget
.
autoRemoveControllerValue
!
==
true
)
{
clear
();
}
}
}
}
}
}
});
});
...
...
lib/src/floating_search_bar.dart
View file @
b9a51039
...
@@ -82,6 +82,7 @@ class FloatingSearchBar extends ImplicitlyAnimatedWidget {
...
@@ -82,6 +82,7 @@ class FloatingSearchBar extends ImplicitlyAnimatedWidget {
this
.
showCursor
=
true
,
this
.
showCursor
=
true
,
bool
initiallyHidden
=
false
,
bool
initiallyHidden
=
false
,
this
.
onKeyEvent
,
this
.
onKeyEvent
,
this
.
autoRemoveControllerValue
,
})
:
showAfter
=
})
:
showAfter
=
showAfter
??
(
initiallyHidden
?
const
Duration
(
days:
1
)
:
null
),
showAfter
??
(
initiallyHidden
?
const
Duration
(
days:
1
)
:
null
),
super
(
key
,
implicitDuration
,
implicitCurve
);
super
(
key
,
implicitDuration
,
implicitCurve
);
...
@@ -407,6 +408,8 @@ class FloatingSearchBar extends ImplicitlyAnimatedWidget {
...
@@ -407,6 +408,8 @@ class FloatingSearchBar extends ImplicitlyAnimatedWidget {
/// this `FloatingSearchBar`.
/// this `FloatingSearchBar`.
final
EdgeInsets
scrollPadding
;
final
EdgeInsets
scrollPadding
;
final
bool
?
autoRemoveControllerValue
;
@override
@override
FloatingSearchBarState
createState
()
=>
FloatingSearchBarState
();
FloatingSearchBarState
createState
()
=>
FloatingSearchBarState
();
...
@@ -766,6 +769,7 @@ class FloatingSearchBarState extends ImplicitlyAnimatedWidgetState<
...
@@ -766,6 +769,7 @@ class FloatingSearchBarState extends ImplicitlyAnimatedWidgetState<
titleStyle:
widget
.
queryStyle
,
titleStyle:
widget
.
queryStyle
,
shadowColor:
style
.
shadowColor
,
shadowColor:
style
.
shadowColor
,
onKeyEvent:
widget
.
onKeyEvent
,
onKeyEvent:
widget
.
onKeyEvent
,
autoRemoveControllerValue:
widget
.
autoRemoveControllerValue
,
);
);
return
SizedBox
.
expand
(
return
SizedBox
.
expand
(
...
...
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