showPicture function

Widget showPicture(
  1. String path, {
  2. double height = 150,
})

Implementation

Widget showPicture(String path, {double height = 150}) {
  if (path.contains('.json')) {
    return Lottie.asset(
      path,
      height: height,
      fit: BoxFit.fitHeight,
    );
  } else if (path.contains('.png') || path.contains('.jpg')) {
    return Image.asset(
      path,
      height: height,
      fit: BoxFit.fitHeight,
    );
  } else if (path.contains('.svg')) {
    return SvgPicture.asset(
      path,
      height: height,
      fit: BoxFit.fitHeight,
    );
  }

  return FlutterLogo(
    size: height,
  );
}