imageFile function

Widget imageFile(
  1. File file, {
  2. Color? color,
  3. double? width,
  4. double? height,
  5. BoxFit fit = BoxFit.contain,
  6. Clip clipBehavior = Clip.hardEdge,
  7. double borderRadius = 1,
  8. EdgeInsets margin = EdgeInsets.zero,
  9. VoidCallback? onTap,
})

Implementation

Widget imageFile(
  final File file, {
  final Color? color,
  final double? width,
  final double? height,
  final BoxFit fit = BoxFit.contain,
  final Clip clipBehavior = Clip.hardEdge,
  final double borderRadius = 1,
  final EdgeInsets margin = EdgeInsets.zero,
  final VoidCallback? onTap,
}) =>
    GestureDetector(
      onTap: onTap,
      child: Container(
        clipBehavior: Clip.hardEdge,
        decoration: BoxDecoration(borderRadius: BorderRadius.circular(borderRadius)),
        margin: margin,
        width: width,
        height: height,
        child: Image.file(file, color: color, width: width, height: height, fit: fit),
      ),
    );