Skip to content
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

update for MaterialSearchResult #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

ahmdrz
Copy link

@ahmdrz ahmdrz commented Oct 7, 2018

Hi,
I think this code down here is more customized.

@ahmdrz
Copy link
Author

ahmdrz commented Oct 7, 2018

_buildMaterialSearchPage(BuildContext context) {
    return new MaterialPageRoute<String>(
        settings: new RouteSettings(
          name: 'material_search',
          isInitialRoute: false,
        ),
        builder: (BuildContext context) {
          return new Material(
            child: new MaterialSearch<String>(
              placeholder: 'Search',
              results: list
                  .map(
                    (String s) => new MaterialSearchResult<String>(
                          widget: ListTile(
                            subtitle: Text("Hello from subtitle"),
                            leading: Icon(Icons.dehaze),
                            title: Text("Hello"),
                          ),
                          value: s,
                        ),
                  )
                  .toList(),
              filter: (dynamic value, String criteria) {
                ...
              },
              onSelect: (dynamic value) {
                ...
              },
              onSubmit: (dynamic value) {},
            ),
          );
        });
  }

Here is an example how to use that.

@ianldgs
Copy link
Owner

ianldgs commented Oct 8, 2018

Will check this later today, but loved the idea!

@ahmdrz
Copy link
Author

ahmdrz commented Oct 26, 2018

Heeelloo ? :)))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants