whenData method
This is the callback used to build the list/grid when data is available
Implementation
@override
Widget whenData(BuildContext context, List<T> items) {
if (items.isEmpty && emptyBuilder != null) {
return emptyBuilder?.call(context) ?? const SliverToBoxAdapter();
}
return SliverList(
delegate: SliverChildBuilderDelegate(
(context, index) => itemBuilder(items[index]),
childCount: items.length,
),
);
}