'Flutter TextFormFeild on web will not get white space. Works perfect when run in dubug but not when hosted
I have a textformfeild that works perfectly on android and ios as well as flutter web in debug mode. When I deploy the app to hosting the text form feild will not allow white spaces what so ever. Any help would be appricated.
TextFormField(
keyboardType: TextInputType.name,
controller: \_input,
autofocus: false,
decoration: InputDecoration(
border: const UnderlineInputBorder(),
labelText: 'Type Here to Add An Area',
prefixIcon: const Icon(Icons.adb),
suffixIcon: GestureDetector(
onTap: () async {
if (\_input.text == '') {
showErrorDialog(
context: context,
title: 'error',
error: 'The Field can't be empty');
setState(() {
});
return;
}
final translator = GoogleTranslator();
var _turkish = await translator
.translate(_input.text, to: 'tr');
var _russian = await translator
.translate(_input.text, to: 'ru');
_items.add({
'en': _input.text.titleCase,
'tr': _turkish.text.titleCase,
'ru': _russian.text.titleCase
});
_items.insert(0, {
});
FirebaseFirestore.instance
.collection('options')
.doc('area')
.update({
'area': _items,
}).onError((error, stackTrace) => showErrorDialog(
context: context,
title: 'error',
error: error.toString()));
setState(() {
_input.clear();
});
setState(() {
_input.clear();
});
},
child: const CircleAvatar(child: Icon(Icons.add)),
),
),
),
I have changed the keyboard type and tried adding to main dart
material( shortcuts: { LogicalKeySet(LogicalKeyboardKey.space): ActivateIntent(), }, )
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
