Skip to content

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