TImage constructor

const TImage({
  1. Key? key,
  2. String? image,
  3. File? file,
  4. BoxBorder? border,
  5. double? width = 56,
  6. double? height = 56,
  7. Uint8List? memoryImage,
  8. Color? overlayColor,
  9. required ImageType imageType,
  10. Color? backgroundColor,
  11. double? padding,
  12. double? margin,
  13. BoxFit? fit = BoxFit.contain,
  14. bool applyImageRadius = true,
  15. double? borderRadius,
  16. BoxShape imageShape = BoxShape.rectangle,
})

A customizable image widget with the option to display the image in a circular or rectangular shape.

  • imageType determines the source of the image (network, memory, file, or asset).
  • applyImageRadius decides whether the image should have rounded corners.
  • width and height set the dimensions of the image.
  • overlayColor applies a color overlay on top of the image.
  • backgroundColor is the color of the background behind the image.
  • padding and margin control the space around the image.
  • borderRadius allows for custom rounding of the image corners.
  • imageShape you can set imageShape either BoxShape.circle OR BoxShape.rectangle.

Implementation

const TImage({
  super.key,
  this.image,
  this.file,
  this.border,
  this.width = 56,
  this.height = 56,
  this.memoryImage,
  this.overlayColor,
  required this.imageType,
  this.backgroundColor,
  this.padding,
  this.margin,
  this.fit = BoxFit.contain,
  this.applyImageRadius = true,
  this.borderRadius,
  this.imageShape = BoxShape.rectangle,
});