Skip to content

update for MaterialSearchResult#34

Open
ahmdrz wants to merge 1 commit into
ianldgs:masterfrom
ahmdrz:master
Open

update for MaterialSearchResult#34
ahmdrz wants to merge 1 commit into
ianldgs:masterfrom
ahmdrz:master

Conversation

@ahmdrz

@ahmdrz ahmdrz commented Oct 7, 2018

Copy link
Copy Markdown

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

@ahmdrz

ahmdrz commented Oct 7, 2018

Copy link
Copy Markdown
Author
_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

ianldgs commented Oct 8, 2018

Copy link
Copy Markdown
Owner

Will check this later today, but loved the idea!

@ahmdrz

ahmdrz commented Oct 26, 2018

Copy link
Copy Markdown
Author

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