CardImage constructor
const
CardImage({})
Creates a CardImage.
The image parameter is required and should contain the primary
visual content. All other parameters are optional and provide
customization for layout, interaction, and styling.
Parameters:
image(Widget, required): primary image contenttitle(Widget?): optional title text or widgetsubtitle(Widget?): optional subtitle below titletrailing(Widget?): optional widget on the end sideleading(Widget?): optional widget on the start sideonPressed(VoidCallback?): tap callback, enables interactionenabled(bool?): whether card responds to interactionstyle(AbstractButtonStyle?): custom button stylingdirection(Axis?): vertical or horizontal layouthoverScale(double?): image scale on hover (default: 1.05)normalScale(double?): normal image scale (default: 1.0)backgroundColor(Color?): image background colorborderColor(Color?): image border colorgap(double?): spacing between image and content
Example:
CardImage(
image: Image.asset('assets/photo.jpg'),
title: Text('Beautiful Landscape'),
subtitle: Text('Captured in the mountains'),
direction: Axis.horizontal,
hoverScale: 1.1,
onPressed: () => showDetails(),
);
Implementation
const CardImage({
super.key,
required this.image,
this.title,
this.subtitle,
this.trailing,
this.leading,
this.onPressed,
this.enabled,
this.style,
this.direction,
this.hoverScale,
this.normalScale,
this.backgroundColor,
this.borderColor,
this.gap,
});