simple static method
Widget
simple(
{ - required String imageUrl,
- GlobalKey<State<StatefulWidget>>? key,
- double? width = double.infinity,
- double? height,
- BoxFit fit = BoxFit.cover,
- Widget? placeholder,
- Widget? errorWidget,
- BorderRadius? borderRadius,
- double? borderWidth,
- Color borderColor = Colors.white,
})
Implementation
static Widget simple({
required String imageUrl,
GlobalKey? key,
double? width = double.infinity,
double? height,
BoxFit fit = BoxFit.cover,
Widget? placeholder,
Widget? errorWidget,
BorderRadius? borderRadius,
double? borderWidth,
Color borderColor = Colors.white,
}) {
var image = CachedNetworkImage(
width: width,
height: height,
fit: fit,
imageUrl: imageUrl,
placeholder: (context, url) =>
placeholder ??
const Icon(
Icons.downloading,
),
errorWidget: (context, url, error) =>
errorWidget ??
const Icon(
Icons.error,
),
);
return Stack(
key: key,
children: _getImages(
image,
borderRadius,
borderWidth,
borderColor,
width,
height,
),
);
}