ExAccordion constructor

const ExAccordion({
  1. Key? key,
  2. String? title,
  3. Widget? content,
  4. Widget? titleChild,
  5. Widget? contentChild,
  6. Color? collapsedTitleBackgroundColor,
  7. Color? expandedTitleBackgroundColor,
  8. Widget collapsedIcon = const Icon(Icons.keyboard_arrow_down_rounded),
  9. Widget expandedIcon = const Icon(Icons.keyboard_arrow_up_rounded),
  10. TextStyle textStyle = const TextStyle(fontSize: 16),
  11. EdgeInsets titlePadding = const EdgeInsets.all(10),
  12. Color? contentBackgroundColor,
  13. EdgeInsets contentPadding = const EdgeInsets.all(10),
  14. Border titleBorder = const Border(),
  15. Color? contentBorderColor,
  16. EdgeInsets? margin,
  17. bool showAccordion = false,
  18. dynamic onToggleCollapsed(
    1. bool
    )?,
  19. BorderRadius titleBorderRadius = const BorderRadius.only(topLeft: Radius.circular(12), topRight: Radius.circular(12)),
  20. BorderRadius contentBorderRadius = const BorderRadius.only(bottomLeft: Radius.circular(12), bottomRight: Radius.circular(12)),
})

An accordion is used to show (and hide) content. Use showAccordion to hide & show the accordion content.

Implementation

const ExAccordion({
  super.key,
  this.title,
  this.content,
  this.titleChild,
  this.contentChild,
  this.collapsedTitleBackgroundColor,
  this.expandedTitleBackgroundColor,
  this.collapsedIcon = const Icon(Icons.keyboard_arrow_down_rounded),
  this.expandedIcon = const Icon(Icons.keyboard_arrow_up_rounded),
  this.textStyle = const TextStyle(fontSize: 16),
  this.titlePadding = const EdgeInsets.all(10),
  this.contentBackgroundColor,
  this.contentPadding = const EdgeInsets.all(10),
  this.titleBorder = const Border(),
  this.contentBorderColor,
  this.margin,
  this.showAccordion = false,
  this.onToggleCollapsed,
  this.titleBorderRadius = const BorderRadius.only(
    topLeft: Radius.circular(12),
    topRight: Radius.circular(12),
  ),
  this.contentBorderRadius = const BorderRadius.only(
    bottomLeft: Radius.circular(12),
    bottomRight: Radius.circular(12),
  ),
});