Figure constructor
Figure({})
Creates a figure from image and optional caption.
Implementation
Figure({
required Object image,
Object? caption,
String? className,
Map<String, Object?> props = const {},
Map<String, Object?> style = const {},
DartStyle? dartStyle,
DartStyle? captionStyle,
Map<String, Object?> captionProps = const {},
}) : super(
'figure',
props: mergeComponentProps(
props,
className: className,
defaultStyle: const {'display': 'grid', 'gap': '8px', 'margin': '0'},
dartStyle: dartStyle,
style: style,
),
children: [
toFlintNode(image),
if (caption != null)
FlintElement(
'figcaption',
props: mergeComponentProps(
captionProps,
defaultStyle: const {
'color': '#667085',
'font-size': '14px',
'line-height': '1.5',
},
dartStyle: captionStyle,
),
children: normalizeChildren(caption, const []),
),
],
);