getResource function

Widget getResource(
  1. ResourceDetail resourceInfo, [
  2. BuildContext? context,
  3. int index = 0
])

Implementation

Widget getResource(ResourceDetail resourceInfo,
    [BuildContext? context, int index = 0]) {
  Widget resource = getResourceVideo(
    VideoDetail(
        url:
            'https://flutter.github.io/assets-for-api-docs/assets/videos/bee.mp4'),
    context,
    index,
  );
  if (resourceInfo.type == ResourceType.video) {
    resource = getResourceVideo(resourceInfo as VideoDetail, context, index);
  } else if (resourceInfo.type == ResourceType.pic) {
    resource = getResourceImage(resourceInfo as ImageDetail, context, index);
  } else if (resourceInfo.type == ResourceType.pics) {
    resource =
        getResourceImageList(resourceInfo as ImageListDetail, context, index);
  }

  return ResourceCard(resourceInfo, resource);
}