ImageWithStyle constructor
const
ImageWithStyle({
- Key? key,
- required ImageProvider<
Object> image, - ImageStyle style = const ImageStyle(),
- 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});