Canvas constructor
Canvas({})
Creates a canvas element.
Implementation
Canvas({
this.controller,
int width = 300,
int height = 150,
String? className,
Map<String, Object?> props = const {},
Map<String, Object?> style = const {},
DartStyle? dartStyle,
}) : super(
'canvas',
props: mergeComponentProps(
{
...props,
if (controller != null) '_flintCanvasController': controller,
'width': width,
'height': height,
'tabIndex': props['tabIndex'] ?? 0,
},
className: className,
defaultStyle: const {
'display': 'block',
'max-width': '100%',
'touch-action': 'none',
},
dartStyle: dartStyle,
style: style,
),
);