listHeader<T> function

SunnyListWidgetBuilder<T> listHeader<T>(
  1. Widget widget, {
  2. bool hideWhenEmpty = true,
})

Implementation

SunnyListWidgetBuilder<T> listHeader<T>(Widget widget,
    {bool hideWhenEmpty = true}) {
  return (context, list) {
    return (hideWhenEmpty == true && list.isNotEmpty) ? widget : emptyBox;
  };
}