# AccordionSection constructor Null safety

AccordionSection(

1. {UniqueKey? key,
2. int index = 0,
3. bool isOpen = false,
4. required String headerText,
5. required Widget content,
6. Color? headerBackgroundColor,
7. double? headerBorderRadius,
8. TextAlign? headerTextAlign,
9. TextStyle? headerTextStyle,
10. EdgeInsets? headerPadding,
11. Widget? leftIcon,
12. Widget? rightIcon,
13. bool? flipRightIconIfOpen = true,
14. Color? contentBackgroundColor,
15. Color? contentBorderColor,
16. double? contentBorderWidth,
17. double? contentBorderRadius,
18. double? contentHorizontalPadding,
19. double? contentVerticalPadding,
20. double? paddingBetweenOpenSections,
21. double? paddingBetweenClosedSections,
22. ScrollIntoViewOfItems? scrollIntoViewOfItems}

)

## Implementation

    AccordionSection({
      this.key,
      this.index = 0,
      bool isOpen = false,
      required this.headerText,
      required this.content,
      Color? headerBackgroundColor,
      double? headerBorderRadius,
      TextAlign? headerTextAlign,
      TextStyle? headerTextStyle,
      EdgeInsets? headerPadding,
      Widget? leftIcon,
      Widget? rightIcon,
      bool? flipRightIconIfOpen = true,
      Color? contentBackgroundColor,
      Color? contentBorderColor,
      double? contentBorderWidth,
      double? contentBorderRadius,
      double? contentHorizontalPadding,
      double? contentVerticalPadding,
      double? paddingBetweenOpenSections,
      double? paddingBetweenClosedSections,
      ScrollIntoViewOfItems? scrollIntoViewOfItems,
    }) {
      _sectionCtrl = SectionController();
      _sectionCtrl.isSectionOpen.value = isOpen;

      this._headerBackgroundColor = headerBackgroundColor;
      this._headerBorderRadius = headerBorderRadius;
      this._headerTextAlign = headerTextAlign;
      this._headerTextStyle = headerTextStyle;
      this._headerPadding = headerPadding;
      this._leftIcon = leftIcon;
      this._rightIcon = rightIcon;
      this._flipRightIconIfOpen = flipRightIconIfOpen ?? true;
      this._contentBackgroundColor = contentBackgroundColor;
      this._contentBorderColor = contentBorderColor;
      this._contentBorderWidth = contentBorderWidth;
      this._contentBorderRadius = contentBorderRadius;
      this._contentHorizontalPadding = contentHorizontalPadding ?? 10;
      this._contentVerticalPadding = contentVerticalPadding ?? 10;
      this._paddingBetweenOpenSections = paddingBetweenOpenSections;
      this._paddingBetweenClosedSections = paddingBetweenClosedSections;
      this._scrollIntoViewOfItems = scrollIntoViewOfItems ?? ScrollIntoViewOfItems.fast;
    }