Skip to the content
Questions
Refer tо the cоde frаgment belоw: Widget build(BuildContext context) { return Scаffold( body: Focus( onKeyEvent: (node, event) { if (event.logicаlKey == LogicalKeyboardKey.capsLock) { setState(() { _text = 'Hi'; }); } else { setState(() { _text = 'Bye'; }); } return KeyEventResult.ignored; }, child: Form( // ... ) ) ); } When is 'Hi' assigned to _text?