Expander.builder constructor

Expander.builder({
  1. required Widget builder(
    1. BuildContext context,
    2. Widget arrow
    ),
  2. required AnimationController controller,
  3. VoidCallback? onHide,
  4. VoidCallback? onShow,
  5. Duration? arrowRotationDuration,
  6. bool rotateArrow = true,
  7. Color rotatingArrowColor = Colors.green,
  8. double rotatingArrowSize = 20,
})

Provides a BuildContext and the rotating arrow so you can place it wherever you need to

controller Controls which expander triggers which expandable. Must not be null and should be the same as its Expandable's controller

triggerWidgets Widgets that will trigger the expansion animation

onHide This callback will be callend every time the animation controller is reversed (the expanded widget hides)

onShow This callback will be callend every time the animation controller is forwarded (the expanded widget shows)

arrowRotationDuration How long will it take to the arrow to rotate

showRotatingArrow Defaults to true

rotateArrow Defaults to true

rotatingArrowColor You may change the color of the rotating arrow

rotatingArrowSize You may change the size of the rotating arrow

Implementation

/// [onHide] This callback will be callend every time the animation controller is reversed (the expanded widget hides)
///
/// [onShow] This callback will be callend every time the animation controller is forwarded (the expanded widget shows)
///
/// [arrowRotationDuration] How long will it take to the arrow to rotate
///

/// [showRotatingArrow] Defaults to true
///
/// [rotateArrow] Defaults to true
///
/// [rotatingArrowColor] You may change the color of the rotating arrow
///
/// [rotatingArrowSize] You may change the size of the rotating arrow
///
factory Expander.builder({
  required Widget Function(BuildContext context, Widget arrow) builder,
  required AnimationController controller,
  VoidCallback? onHide,
  VoidCallback? onShow,
  Duration? arrowRotationDuration,
  bool rotateArrow = true,
  Color rotatingArrowColor = Colors.green,
  double rotatingArrowSize = 20,
}) {
  return Expander._(
    onHide: onHide,
    onShow: onShow,
    builder: builder,
    arrowRotationDuration: arrowRotationDuration,
    controller: controller,
    rotateArrow: rotateArrow,
    rotatingArrowColor: rotatingArrowColor,
    rotatingArrowSize: rotatingArrowSize,
  );
}