Reputation: 1089
I have a simple app that takes a barcode input from the host and when it's done with the barcode it returns/enters.
When I run my app on an iOS simulator the enter key works fine with this TextField, however on my Android emulator, return does nothing and you need to actually click the tick to submit.
Is there a way to make the Android one work like the iOS?
new TextField(
controller: _newBarcodeTextfield,
maxLines: 1,
keyboardType: TextInputType.text,
autofocus: true,
onSubmitted: (newBarcodeInput) {
_getProductInfo(newBarcodeInput);
}
),
Upvotes: 0
Views: 172
Reputation: 1089
I just added a RawKeyboardListener
and listened out for key 66 which is return. Don't know why onSubmitted
didn't act the same as iOS so if someone knows I'd like to know.
Upvotes: 1