GFAccordion constructor

const GFAccordion({
  1. Key? key,
  2. String? title,
  3. String? content,
  4. Widget? titleChild,
  5. Widget? contentChild,
  6. Color collapsedTitleBackgroundColor = GFColors.WHITE,
  7. Color expandedTitleBackgroundColor = const Color(0xFFE0E0E0),
  8. Widget collapsedIcon = const Icon(Icons.keyboard_arrow_down),
  9. Widget expandedIcon = const Icon(Icons.keyboard_arrow_up),
  10. TextStyle textStyle = const TextStyle(color: Colors.black, 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. Border contentBorder = const Border(),
  16. EdgeInsets? margin,
  17. bool showAccordion = false,
  18. dynamic onToggleCollapsed(
    1. bool
    )?,
  19. BorderRadius titleBorderRadius = const BorderRadius.all(Radius.circular(0)),
  20. BorderRadius contentBorderRadius = const BorderRadius.all(Radius.circular(0)),
})

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

Implementation

const GFAccordion(
    {Key? key,
    this.title,
    this.content,
    this.titleChild,
    this.contentChild,
    this.collapsedTitleBackgroundColor = GFColors.WHITE,
    this.expandedTitleBackgroundColor = const Color(0xFFE0E0E0),
    this.collapsedIcon = const Icon(Icons.keyboard_arrow_down),
    this.expandedIcon = const Icon(Icons.keyboard_arrow_up),
    this.textStyle = const TextStyle(color: Colors.black, fontSize: 16),
    this.titlePadding = const EdgeInsets.all(10),
    this.contentBackgroundColor,
    this.contentPadding = const EdgeInsets.all(10),
    this.titleBorder = const Border(),
    this.contentBorder = const Border(),
    this.margin,
    this.showAccordion = false,
    this.onToggleCollapsed,
    this.titleBorderRadius = const BorderRadius.all(Radius.circular(0)),
    this.contentBorderRadius = const BorderRadius.all(Radius.circular(0))})
    : super(key: key);