I have a small flutter app for the web and am showing a TextField.
I now need a callback like onSubmitted whenever the user either leaves the TextField (focus loss) or presses the Enter key. Right now I can't make any callback happen at all.
TextField(
decoration: InputDecoration(
labelText: 'Name',
),
controller: TextEditingController(text: event.name),
onEditingComplete: () { print("editing complete"); },
onSubmitted: (String value) { print("submitted\n"); },
maxLines: 1,
),