Commit f307e8c0 by Rizal Hermawan

refacto r: textinput value will appear if autoRemoveControllerValue is false

parent 8ba3cfcc
...@@ -730,6 +730,12 @@ class FloatingSearchBarState extends ImplicitlyAnimatedWidgetState< ...@@ -730,6 +730,12 @@ class FloatingSearchBarState extends ImplicitlyAnimatedWidgetState<
} }
Widget _buildInnerBar() { Widget _buildInnerBar() {
String hintValue = widget.hint!;
if (widget.autoRemoveControllerValue == false) {
if (widget.controller!.query.isEmpty == false) {
hintValue = widget.controller!.query;
}
}
final FloatingSearchAppBar textField = FloatingSearchAppBar( final FloatingSearchAppBar textField = FloatingSearchAppBar(
showCursor: widget.showCursor, showCursor: widget.showCursor,
body: null, body: null,
...@@ -749,7 +755,7 @@ class FloatingSearchBarState extends ImplicitlyAnimatedWidgetState< ...@@ -749,7 +755,7 @@ class FloatingSearchBarState extends ImplicitlyAnimatedWidgetState<
autocorrect: widget.autocorrect, autocorrect: widget.autocorrect,
clearQueryOnClose: widget.clearQueryOnClose, clearQueryOnClose: widget.clearQueryOnClose,
debounceDelay: widget.debounceDelay, debounceDelay: widget.debounceDelay,
hint: widget.autoRemoveControllerValue == false ? widget.controller!.query : widget.hint, hint: hintValue,
onQueryChanged: widget.onQueryChanged, onQueryChanged: widget.onQueryChanged,
onSubmitted: widget.onSubmitted, onSubmitted: widget.onSubmitted,
progress: widget.progress, progress: widget.progress,
......
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