AspectRatioBox constructor

AspectRatioBox({
  1. required Object ratio,
  2. Object? child,
  3. List<Object?> children = const [],
  4. Object? width,
  5. Object? overflow,
  6. String? className,
  7. Map<String, Object?> props = const {},
  8. Map<String, Object?> style = const {},
  9. DartStyle? dartStyle,
})

Creates an aspect-ratio box from ratio.

Implementation

AspectRatioBox({
  required Object ratio,
  Object? child,
  List<Object?> children = const [],
  Object? width,
  Object? overflow,
  String? className,
  Map<String, Object?> props = const {},
  Map<String, Object?> style = const {},
  DartStyle? dartStyle,
}) : super(
       'div',
       props: mergeComponentProps(
         props,
         className: className,
         dartStyle: DartStyle(
           width: width ?? SizeValue.full,
           aspectRatio: ratio,
           overflow: overflow,
         ).merge(dartStyle),
         style: style,
       ),
       children: normalizeChildren(child, children),
     );