ExpandableText constructor

const ExpandableText({
  1. Key? key,
  2. required Text textWidget,
  3. Function? onPressed,
  4. EdgeInsets padding = const EdgeInsets.all(4.0),
  5. Color backgroundColor = Colors.white,
  6. Duration animationDuration = const Duration(milliseconds: 500),
  7. DecorationImage? backgroundImage,
  8. bool initiallyExpanded = false,
  9. void onHover(
    1. bool
    )?,
  10. Widget? arrowWidget = const Icon(Icons.keyboard_arrow_down_rounded, color: Colors.black, size: 25.0),
  11. ArrowLocation? arrowLocation = ArrowLocation.right,
  12. ArrowLocation? finalArrowLocation = ArrowLocation.right,
  13. List<String> helperTextList = const ['...Show More', '...Show Less'],
  14. TextStyle? helperTextStyle,
  15. BorderRadius? borderRadius,
  16. Helper helper = Helper.arrow,
  17. List<BoxShadow>? boxShadow,
})

• Expandable text widget for general use.

textWidget, helper, initiallyExpanded, padding, backgroundColor, helperTextList & animationDuration arguments must not be null.

Implementation

const ExpandableText({
  Key? key,
  required this.textWidget,
  this.onPressed,
  this.padding = const EdgeInsets.all(4.0),
  this.backgroundColor = Colors.white,
  this.animationDuration = const Duration(milliseconds: 500),
  this.backgroundImage,
  this.initiallyExpanded = false,
  this.onHover,
  this.arrowWidget = const Icon(Icons.keyboard_arrow_down_rounded, color: Colors.black, size: 25.0),
  this.arrowLocation = ArrowLocation.right,
  this.finalArrowLocation = ArrowLocation.right,
  this.helperTextList = const ['...Show More', '...Show Less'],
  this.helperTextStyle,
  this.borderRadius,
  this.helper = Helper.arrow,
  this.boxShadow,
})  : assert(helperTextList.length == 2, 'helperTextList must have exactly 2 elements.'),
      super(key: key);