-
-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
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
How to trigger by a /
#100
Comments
/
Hello @lucasjinreal, Thanks for filing the issue. SearchField allows you to show suggestions based on custom logic using I think you should be able to achieve it by doing something like this, onSearchTextChanged: (query) {
List<String> filter = [];
if (query.startsWith('/')) {
filter = suggestions;
}
return filter
.map((e) => SearchFieldListItem<String>(e,
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 4.0),
child: Text(e,
style: TextStyle(fontSize: 24, color: Colors.red)),
)))
.toList();
Let me know if that doesn't work. |
You may also refer this complete code sample in the example app. |
@maheshmnj thanks for your kindly demo. the onSearchTextChanged's params query would be always whole text users input right? I want the pop window suggest only when first if i want |
@lucasjinreal Yes, the query parameter gives the entire text present in the searchfield. That callback is invoked everytime the text input changes in the searchfield meaning if a user types If you want to show suggestions only when text input has first |
@maheshmnj the query of this should be from textController right? So if i want it only detects |
I am just leveraging the Regarding positioning the suggestions on top of searchfield use the offset property
|
@maheshmnj Hello, I have a customized TextField , how to using along with my customized TextField, |
@lucasjinreal At this point It is not possible to use your own textfield to get the searchfield features and there are no plans to do so in the future. May I know what customization you are referring to that is in Textfield but not in searchfield?
This is being tracked here #7 |
@lucasjinreal Keyboard support has been added to Searchfield, Now you should be able to navigate suggestions using the arrow keys, Please use the latest version 0.9.9 |
@lucasjinreal I filed an issue to track trigger-based search where the search suggestion will be shown only when you enter a specific pattern. Please follow up on this issue #116 |
How to manually trigger search only by frist typing
/
, otherwise it can be used as normal text field?The text was updated successfully, but these errors were encountered: