ImageWithStyle constructor

const ImageWithStyle({
  1. Key? key,
  2. required ImageProvider<Object> image,
  3. ImageStyle style = const ImageStyle(),
  4. bool gapless = false,
})

Creates an ImageWithStyle widget.

The image parameter is required and specifies the image provider to use. The style parameter defines how the image should be displayed.

Example:

ImageWithStyle(
  image: NetworkImage("https://example.com/image.jpg"),
  style: ImageStyle(
    fit: BoxFit.cover,
    width: 300,
    height: 200,
  ),
)

Implementation

const ImageWithStyle(
    {super.key,
    required this.image,
    this.style = const ImageStyle(),
    this.gapless = false});