MenuBuilder typedef

MenuBuilder = Widget Function(MenuComponentData data)

This typedef defines a method that returns a Widget that wraps MenuComponentData.searchBar and MenuComponentData.listView in a Widget, defining their layout.

Used by MenuComponent as MenuComponent.builder.

Example

MenuComponent(
  builder: (MenuComponentData data)
  {
    return Card(
      child: Column(
        children: <Widget>[
          data.isSearchEnabled
          ? Expanded(
            child: data.searchBar,
            flex: data.menuFlexValues.searchBar,
          )
          : Container(),// Show an nothing (empty) container when search is disabled.
          Expanded(
            child: data.listView,
            flex: data.menuFlexValues.listView,
          ),
        ],
      ),
    );
  }
);

See Also:

Implementation

typedef MenuBuilder = Widget Function(MenuComponentData data);