ThreeScene constructor

ThreeScene({
  1. ThreeSceneController? controller,
  2. int width = 640,
  3. int height = 360,
  4. String? className,
  5. String? label,
  6. Map<String, Object?> props = const {},
  7. Map<String, Object?> style = const {},
  8. DartStyle? dartStyle,
})

Creates a Three.js scene canvas.

Implementation

ThreeScene({
  this.controller,
  int width = 640,
  int height = 360,
  String? className,
  String? label,
  Map<String, Object?> props = const {},
  Map<String, Object?> style = const {},
  DartStyle? dartStyle,
}) : super(
        'canvas',
        props: mergeComponentProps(
          {
            ...props,
            'width': width,
            'height': height,
            if (controller != null) '_flintThreeSceneController': controller,
            if (label != null) 'aria-label': label,
            if (label == null) 'aria-hidden': true,
            'tabIndex': props['tabIndex'] ?? 0,
          },
          className: className,
          defaultStyle: const {
            'display': 'block',
            'width': '100%',
            'max-width': '100%',
            'height': 'auto',
            'touch-action': 'none',
          },
          dartStyle: dartStyle,
          style: style,
        ),
      );