Expandable.extended constructor Null safety

Expandable.extended(
  1. {Widget? primaryWidget,
  2. Widget? secondaryWidget,
  3. Widget? additionalWidget,
  4. Function? onPressed,
  5. Color? backGroundColor = Colors.white,
  6. double? elevation = 0,
  7. ShapeBorder? shape,
  8. EdgeInsets? padding = const EdgeInsets.all(20.0),
  9. Duration? animationDuration = const Duration(milliseconds: 100),
  10. Duration? beforeAnimationDuration,
  11. DecorationImage? backgroundImage,
  12. bool? hoverOn,
  13. bool? initiallyExpanded,
  14. bool? centralizePrimaryWidget = false,
  15. bool? centralizeAdditionalWidget = false,
  16. Widget? arrowWidget,
  17. bool? isClickable = true,
  18. ArrowLocation? arrowLocation = ArrowLocation.right}
)

• Almost similar to Expandable.

• Takes an additionalWidget which behaves like subtitle.

additionalWidget brings an iconWidget next to it.

• See ExpandableWidget for more details.

Implementation

Expandable.extended({
  Widget? primaryWidget,
  Widget? secondaryWidget,
  Widget? additionalWidget,
  Function? onPressed,
  Color? backGroundColor = Colors.white,
  double? elevation = 0,
  ShapeBorder? shape,
  EdgeInsets? padding = const EdgeInsets.all(20.0),
  Duration? animationDuration = const Duration(milliseconds: 100),
  Duration? beforeAnimationDuration,
  DecorationImage? backgroundImage,
  bool? hoverOn,
  bool? initiallyExpanded,
  bool? centralizePrimaryWidget = false,
  bool? centralizeAdditionalWidget = false,
  Widget? arrowWidget,
  bool? isClickable = true,
  ArrowLocation? arrowLocation = ArrowLocation.right,
})  : assert(primaryWidget != null || secondaryWidget != null),
      assert((isClickable == false && arrowWidget != null) ||
          (isClickable == true)),
      assert(arrowLocation != ArrowLocation.bottom &&
          arrowLocation != ArrowLocation.top),
      super(
        primaryWidget: primaryWidget,
        secondaryWidget: secondaryWidget,
        additionalWidget: additionalWidget,
        onPressed: onPressed,
        backgroundColor: backGroundColor,
        elevation: elevation,
        shape: shape,
        animationDuration: animationDuration,
        beforeAnimationDuration: beforeAnimationDuration,
        padding: padding,
        backgroundImage: backgroundImage,
        hoverOn: hoverOn,
        initiallyExpanded: initiallyExpanded,
        centralizePrimaryWidget: centralizePrimaryWidget,
        centralizeAdditionalWidget: centralizeAdditionalWidget,
        arrowWidget: arrowWidget,
        isClickable: isClickable,
        arrowLocation: arrowLocation,
      );