close indication
hi there,
is there any indication for search close without selection (such as back press event or outside click)?
what i'm trying to do is to implement a functionality where there is dim screen behind the results list only when its open.
if it helps ill share my own temp workaround `...
bool isAutocompleteOpen = false; FocusNode _searchBoxFocusNode;
...
Widget _body() => Stack(children: <Widget>[ Container( padding: EdgeInsets.symmetric(horizontal: 20.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.max, children: <Widget>[ _searchBar(), _dimScreen() ])), ]);
...
@override void initState() { super.initState(); _searchBoxFocusNode = FocusNode()..addListener(_searchBoxFocusListener); }
...
void _searchBoxFocusListener() { setState(() { isAutocompleteOpen = _searchBoxFocusNode.hasFocus; }); }
...
_autocompleteSearchBox() => TypeAheadField( suggestionsBoxController: _suggestionsBoxController, textFieldConfiguration: TextFieldConfiguration( focusNode: _searchBoxFocusNode, autofocus: false, ...
_dimScreen() => IgnorePointer( child: Container( decoration: BoxDecoration( color: isAutocompleteOpen ? Colors.black26 : Colors.transparent)));
`