ExAccordion constructor
const
ExAccordion({
- Key? key,
- String? title,
- Widget? content,
- Widget? titleChild,
- Widget? contentChild,
- Color? collapsedTitleBackgroundColor,
- Color? expandedTitleBackgroundColor,
- Widget collapsedIcon = const Icon(Icons.keyboard_arrow_down_rounded),
- Widget expandedIcon = const Icon(Icons.keyboard_arrow_up_rounded),
- TextStyle textStyle = const TextStyle(fontSize: 16),
- EdgeInsets titlePadding = const EdgeInsets.all(10),
- Color? contentBackgroundColor,
- EdgeInsets contentPadding = const EdgeInsets.all(10),
- Border titleBorder = const Border(),
- Color? contentBorderColor,
- EdgeInsets? margin,
- bool showAccordion = false,
- dynamic onToggleCollapsed()?,
- BorderRadius titleBorderRadius = const BorderRadius.only(topLeft: Radius.circular(12), topRight: Radius.circular(12)),
- 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),
),
});