TolyCollapse constructor

const TolyCollapse({
  1. Key? key,
  2. required Widget content,
  3. Widget? title,
  4. Curve opacityCurve = Curves.linear,
  5. Curve sizeCurve = Curves.linear,
  6. AlignmentGeometry alignment = Alignment.topCenter,
  7. EdgeInsetsGeometry titlePadding = const EdgeInsets.symmetric(vertical: 12.0),
  8. EdgeInsetsGeometry contentPadding = const EdgeInsets.only(top: 0, right: 8, left: 8, bottom: 8),
  9. required Duration duration,
  10. Duration? reverseDuration,
  11. AnimatedTitleBuilder? titleBuilder,
  12. CollapseController? controller,
  13. VoidCallback? onOpen,
  14. VoidCallback? onClose,
  15. bool excludeBottomFocus = true,
})

Creates a cross-fade animation widget.

The duration of the animation is the same for all components (fade in, fade out, and size), and you can pass Intervals instead of Curves in order to have finer control, e.g., creating an overlap between the fades.

Implementation

const TolyCollapse({
  super.key,
  required this.content,
  this.title,
  this.opacityCurve = Curves.linear,
  this.sizeCurve = Curves.linear,
  this.alignment = Alignment.topCenter,
  this.titlePadding = const EdgeInsets.symmetric(vertical: 12.0),
  this.contentPadding =
      const EdgeInsets.only(top: 0, right: 8, left: 8, bottom: 8),
  required this.duration,
  this.reverseDuration,
  this.titleBuilder,
  this.controller,
  this.onOpen,
  this.onClose,
  this.excludeBottomFocus = true,
}) : assert(title == null && titleBuilder != null ||
          titleBuilder == null && title != null ||
          titleBuilder != null && title != null);