Answers for "focuis node unfocus flutter"

0

nodeFocus flutter

FocusNode focusNode;

void initState() {
  focusNode = new FocusNode();

  // listen to focus changes
  focusNode.addListener(() => print('focusNode updated: hasFocus: ${focusNode.hasFocus}')); 
}

void setFocus() {
  FocusScope.of(context).requestFocus(focusNode);
}

Widget build() {
  return
  ...
  new TextField(focusNode: focusNode, ...);
}
Posted by: Guest on January-24-2021

Code answers related to "focuis node unfocus flutter"

Code answers related to "Dart"

Browse Popular Code Answers by Language