AnimatedContainer constructor

AnimatedContainer({
  1. Object? child,
  2. List<Object?> children = const [],
  3. Duration duration = const Duration(milliseconds: 300),
  4. String curve = 'cubic-bezier(0.16, 1, 0.3, 1)',
  5. String? className,
  6. Map<String, Object?> props = const {},
  7. Map<String, Object?> style = const {},
  8. DartStyle? dartStyle,
})

Creates an animated container with custom duration and curve.

Implementation

AnimatedContainer({
  Object? child,
  List<Object?> children = const [],
  Duration duration = const Duration(milliseconds: 300),
  String curve = 'cubic-bezier(0.16, 1, 0.3, 1)',
  String? className,
  Map<String, Object?> props = const {},
  Map<String, Object?> style = const {},
  DartStyle? dartStyle,
}) : super(
        'div',
        props: mergeComponentProps(
          props,
          className: className,
          defaultStyle: {
            'transition': 'all ${duration.inMilliseconds}ms $curve',
          },
          dartStyle: dartStyle,
          style: style,
        ),
        children: normalizeChildren(child, children),
      );