当我的 web 应用程序托管在 firebase 上时,RawKeyboardListener 的 onKey 事件不会触发。当我在 localhost 上托管时,onKey 事件会触发。有谁知道为什么 localhost 和 firebase 托管之间 rawkeyboardlistener 的行为存在差异?
child: RawKeyboardListener(
focusNode: _keyboardListenerNode,
onKey: () {print("rawkeyboardlistener onkey fired");},
child: Form(
key: _formKey,
onChanged: () {
print("Form on changed called");
},
child: TextFormField(
autofocus: true,
focusNode: _textNode,
controller: _controller,
decoration: InputDecoration(
border: InputBorder.none,
labelText: widget._hintText,
suffix: IconButton(
icon: Icon(Icons.cancel),
onPressed: () {},
),
),
onSaved: (val) {
setState(() {
scannedBarcode = val;
});
},
)))