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
7024a6a9
Commit
7024a6a9
authored
Mar 01, 2024
by
Rizal Hermawan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor : clears hint text after click close on appbar
parent
d388ed49
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
9 deletions
+15
-9
lib/src/floating_search_app_bar.dart
+13
-9
lib/src/floating_search_bar.dart
+2
-0
No files found.
lib/src/floating_search_app_bar.dart
View file @
7024a6a9
// ignore_for_file: public_member_api_docs
// ignore_for_file: public_member_api_docs
, must_be_immutable, doc_directive_has_extra_arguments
part of
'floating_search_bar.dart'
;
...
...
@@ -12,7 +12,7 @@ typedef OnFocusChangedCallback = void Function(bool isFocused);
/// This can be considered the base Widget for the full
/// [FloatingSearchBar].
class
FloatingSearchAppBar
extends
ImplicitlyAnimatedWidget
{
const
FloatingSearchAppBar
({
FloatingSearchAppBar
({
Key
?
key
,
Duration
implicitDuration
=
const
Duration
(
milliseconds:
500
),
Curve
implicitCurve
=
Curves
.
linear
,
...
...
@@ -154,7 +154,7 @@ class FloatingSearchAppBar extends ImplicitlyAnimatedWidget {
final
Widget
?
title
;
/// {@macro floating_search_bar.hint}
final
String
?
hint
;
String
?
hint
;
/// {@macro floating_search_bar.actions}
final
List
<
Widget
>?
actions
;
...
...
@@ -212,12 +212,8 @@ class FloatingSearchAppBarState extends ImplicitlyAnimatedWidgetState<
if
(
status
==
AnimationStatus
.
dismissed
)
{
if
(
widget
.
clearQueryOnClose
)
{
if
(
widget
.
autoRemoveControllerValue
==
null
)
{
if
(
widget
.
autoRemoveControllerValue
==
null
||
widget
.
autoRemoveControllerValue
!
==
true
)
{
clear
();
}
else
{
if
(
widget
.
autoRemoveControllerValue
!
==
true
)
{
clear
();
}
}
}
}
...
...
@@ -382,7 +378,15 @@ class FloatingSearchAppBarState extends ImplicitlyAnimatedWidgetState<
_input
.
clearFocus
();
}
void
clear
()
=>
_input
.
clear
();
void
clear
()
{
final
bool
hasQuery
=
!
widget
.
clearQueryOnClose
&&
query
.
isNotEmpty
;
if
(
hasQuery
==
true
)
{
setState
(()
{
widget
.
hint
=
''
;
});
}
_input
.
clear
();
}
void
_assignController
()
=>
widget
.
controller
?.
_appBarState
=
this
;
...
...
lib/src/floating_search_bar.dart
View file @
7024a6a9
// ignore_for_file: doc_directive_has_extra_arguments
import
'dart:math'
;
import
'dart:ui'
;
...
...
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