TolyCollapse constructor
const
TolyCollapse({
- Key? key,
- required Widget content,
- Widget? title,
- Curve opacityCurve = Curves.linear,
- Curve sizeCurve = Curves.linear,
- AlignmentGeometry alignment = Alignment.topCenter,
- EdgeInsetsGeometry titlePadding = const EdgeInsets.symmetric(vertical: 12.0),
- EdgeInsetsGeometry contentPadding = const EdgeInsets.only(top: 0, right: 8, left: 8, bottom: 8),
- required Duration duration,
- Duration? reverseDuration,
- AnimatedTitleBuilder? titleBuilder,
- CollapseController? controller,
- VoidCallback? onOpen,
- VoidCallback? onClose,
- 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);