I am developing a flutter application with below process
- scan number (external Bluetooth barcode scanner)
- upload barcode data
- repeat 1,2 step c
I could able to scan and upload the first data. then I cleared the text. but i could not place the cursor at the _text controller.
I dont want to press the text field every time before scan the textfield.
TextField( controller: _text, textInputAction: TextInputAction.go, onSubmitted: (value) { print(submit online using function"); _text.clear(); _text.selection= TextSelection.collapsed(offset: -1); }, decoration: const InputDecoration( icon: Icon(Icons.person), hintText: 'Enter ID', labelText: 'Enter ID', ), autofocus: true, keyboardType: TextInputType.number, inputFormatters: <TextInputFormatter>[ WhitelistingTextInputFormatter.digitsOnly ], ),