We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Something is mess up. textSubmitted, itemSubmitted both are not calling. Even I debugged too. I am testing in flutter web and mac desktop app.
Code: ` class AutocompleteExample extends StatefulWidget { @OverRide _AutocompleteExampleState createState() => _AutocompleteExampleState(); }
class _AutocompleteExampleState extends State { AutoCompleteTextField? textField; GlobalKey<AutoCompleteTextFieldState> textFieldKey = GlobalKey();
List suggestions = [ 'Apple', 'Banana', 'Cherry', 'Date', 'Grapes', 'Lemon', 'Orange', 'Peach', 'Pear', 'Plum', ];
@OverRide void initState() { super.initState(); textField = AutoCompleteTextField( suggestions: suggestions, clearOnSubmit: false, itemFilter: (item, query) { return item.toLowerCase().startsWith(query.toLowerCase()); }, itemSorter: (a, b) { return a.compareTo(b); }, itemSubmitted: (item) { setState(() { textField!.textField?.controller?.text = item; }); }, textSubmitted: (text) => setState(() { if (text != "") { textField!.textField?.controller?.text = text; } }), itemBuilder: (context, item) { return ListTile( title: Text(item), ); }, key: textFieldKey, ); }
@OverRide Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text('Autocomplete Example'), ), body: Padding( padding: EdgeInsets.all(16.0), child: Column( children: [ textField!, ], ), ), ); } }`
Flutter version: 3.13.4
The text was updated successfully, but these errors were encountered:
Same problem here
Sorry, something went wrong.
No branches or pull requests
Something is mess up.
textSubmitted, itemSubmitted both are not calling. Even I debugged too.
I am testing in flutter web and mac desktop app.
Code:
`
class AutocompleteExample extends StatefulWidget {
@OverRide
_AutocompleteExampleState createState() => _AutocompleteExampleState();
}
class _AutocompleteExampleState extends State {
AutoCompleteTextField? textField;
GlobalKey<AutoCompleteTextFieldState> textFieldKey =
GlobalKey();
List suggestions = [
'Apple',
'Banana',
'Cherry',
'Date',
'Grapes',
'Lemon',
'Orange',
'Peach',
'Pear',
'Plum',
];
@OverRide
void initState() {
super.initState();
textField = AutoCompleteTextField(
suggestions: suggestions,
clearOnSubmit: false,
itemFilter: (item, query) {
return item.toLowerCase().startsWith(query.toLowerCase());
},
itemSorter: (a, b) {
return a.compareTo(b);
},
itemSubmitted: (item) {
setState(() {
textField!.textField?.controller?.text = item;
});
},
textSubmitted: (text) => setState(() {
if (text != "") {
textField!.textField?.controller?.text = text;
}
}),
itemBuilder: (context, item) {
return ListTile(
title: Text(item),
);
},
key: textFieldKey,
);
}
@OverRide
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Autocomplete Example'),
),
body: Padding(
padding: EdgeInsets.all(16.0),
child: Column(
children: [
textField!,
],
),
),
);
}
}`
Flutter version: 3.13.4
The text was updated successfully, but these errors were encountered: