build method Null safety

  1. @override
dynamic build(
  1. dynamic context
)

Implementation

@override
Widget build(BuildContext context) {
  Widget? result;
  result = _buildFromUrl(product.imageFrontSmallUrl);
  if (result != null) {
    return result;
  }
  result = _buildFromUrl(product.imageFrontUrl);
  if (result != null) {
    return result;
  }
  return ClipRRect(
    borderRadius: ROUNDED_BORDER_RADIUS,
    child: FittedBox(
      child: Container(
        width: width,
        height: height,
        decoration: const BoxDecoration(
          borderRadius: ROUNDED_BORDER_RADIUS,
        ),
        child: Center(
          child: SvgPicture.asset(
            'assets/product/product_not_found.svg',
            fit: BoxFit.cover,
          ),
        ),
      ),
    ),
  );
}