buildHistory method

  1. @override
Widget buildHistory(
  1. List<MediaItem> items
)
override

This is shown as the body when shouldPlaceholderBeShown is false.

Implementation

@override
Widget buildHistory(List<MediaItem> items) {
  return RawScrollbar(
    thumbVisibility: true,
    thickness: 3,
    controller: mediaType.scrollController,
    child: GridView.builder(
      padding: const EdgeInsets.only(top: 48),
      gridDelegate: SliverGridDelegateWithMaxCrossAxisExtent(
        maxCrossAxisExtent: 150,
        childAspectRatio: mediaSource.aspectRatio,
      ),
      physics: const AlwaysScrollableScrollPhysics(
        parent: BouncingScrollPhysics(),
      ),
      controller: mediaType.scrollController,
      itemCount: items.length,
      itemBuilder: (context, index) => buildMediaItem(items[index]),
    ),
  );
}