Created
July 18, 2019 06:42
-
-
Save ShivamGoyal1899/76996237c4cea653bcecfc0797e63edd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class _SearchTabState extends State<SearchTab> { | |
TextEditingController _controller; | |
FocusNode _focusNode; | |
String _terms = ''; | |
@override | |
void initState() { | |
super.initState(); | |
_controller = TextEditingController()..addListener(_onTextChanged); | |
_focusNode = FocusNode(); | |
} | |
@override | |
void dispose() { | |
_focusNode.dispose(); | |
_controller.dispose(); | |
super.dispose(); | |
} | |
void _onTextChanged() { | |
setState(() { | |
_terms = _controller.text; | |
}); | |
} | |
Widget _buildSearchBox() { | |
return Padding( | |
padding: const EdgeInsets.all(8), | |
child: SearchBar( | |
controller: _controller, | |
focusNode: _focusNode, | |
), | |
); | |
} // TO HERE | |
@override | |
Widget build(BuildContext context) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment