Comments (5)
Umm yeah, this should most definitely be possible. Just give each autocomplete text field its own global key and you'll be fine.
GlobalKey<AutoCompleteTextFieldState<String>> key1 = new GlobalKey(); //Key for textfield one GlobalKey<AutoCompleteTextFieldState<String>> key2 = new GlobalKey(); //Key for textfield two
from flutter-autocomplete-textfield.
I tried this but it throws an exception
══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
2018-10-22 07:30:43.149 28048-28064/dexterapps.bankifscflutter I/flutter: The following assertion was thrown building
2018-10-22 07:30:43.149 28048-28064/dexterapps.bankifscflutter I/flutter: FancyAutoCompleteTextField-[LabeledGlobalKey<AutoCompleteTextFieldState<String>>#809e7](state:
2018-10-22 07:30:43.149 28048-28064/dexterapps.bankifscflutter I/flutter: _FancyAutoCompleteTextFieldState#47758):
2018-10-22 07:30:43.149 28048-28064/dexterapps.bankifscflutter I/flutter: Multiple widgets used the same GlobalKey.
2018-10-22 07:30:43.149 28048-28064/dexterapps.bankifscflutter I/flutter: The key [LabeledGlobalKey<AutoCompleteTextFieldState<String>>#809e7] was used by multiple widgets.
2018-10-22 07:30:43.149 28048-28064/dexterapps.bankifscflutter I/flutter: The parents of those widgets were:
2018-10-22 07:30:43.149 28048-28064/dexterapps.bankifscflutter I/flutter: - Semantics(container: false, properties: SemanticsProperties, label: null, value: null, hint: null,
2018-10-22 07:30:43.149 28048-28064/dexterapps.bankifscflutter I/flutter: hintOverrides: null, renderObject: RenderSemanticsAnnotations#d5887 NEEDS-LAYOUT NEEDS-PAINT)
2018-10-22 07:30:43.149 28048-28064/dexterapps.bankifscflutter I/flutter: - Padding(padding: EdgeInsets(4.0, 0.0, 4.0, 0.0), renderObject: RenderPadding#e4d36 NEEDS-LAYOUT
2018-10-22 07:30:43.149 28048-28064/dexterapps.bankifscflutter I/flutter: NEEDS-PAINT)
2018-10-22 07:30:43.149 28048-28064/dexterapps.bankifscflutter I/flutter: A GlobalKey can only be specified on one widget at a time in the widget tree.
from flutter-autocomplete-textfield.
2018-10-22 07:30:43.149 28048-28064/dexterapps.bankifscflutter I/flutter: Multiple widgets used the same GlobalKey.
This line states multiple widgets are using the same key. here seems like a good overview of how globalkey works in Flutter.
from flutter-autocomplete-textfield.
thanks,
I am actually using it in a diff way, i created another widget on top of autoComplete widget, due to this i am not able to pass multiple global keys, since doing GlobalKey<AutoCompleteTextFieldState> key1 = new GlobalKey() 2 times also create same instance of Globalkey.
from flutter-autocomplete-textfield.
If you're subclassing the AutoCompleteTextField, you'll need to implement the necessary implementations.
from flutter-autocomplete-textfield.
Related Issues (20)
- Show suggestions on focus - without typing anything HOT 1
- How to use overflow?
- Is there a way to use Stream suggestions from firebase? HOT 2
- Scroll issue & Instance of issue.
- Where is the selected item stored? HOT 1
- Support null-safety HOT 10
- Suggestion's Position HOT 4
- how do i make thr text filtering non case sesitivite but the value remains the same in the suggestions i.e retains its case HOT 1
- Supports Null safety HOT 3
- Diable Field HOT 1
- Please mark this repository as Not Maintained as it is dead since 2019
- Error in example given on pub.dev HOT 1
- sufix icon on focus disappear HOT 2
- Cannot run with sound null safety for ios build in xcode 12.5.1 for Compile and run HOT 1
- Support Null Safety HOT 1
- Problems for flutter 3.7 on web HOT 2
- Controller is not getting updated on textsubmitted HOT 1
- Material 3
- textSubmitted, itemSubmitted is not calling in flutter web and desktop app.
- Keyboard covering dropdown on auto-complete
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter-autocomplete-textfield.