ExpansionPanelList.radio constructor Null safety

const ExpansionPanelList.radio(
  1. {Key? key,
  2. List<ExpansionPanel> children = const <ExpansionPanelRadio>[],
  3. ExpansionPanelCallback? expansionCallback,
  4. Duration animationDuration = kThemeAnimationDuration,
  5. Object? initialOpenPanelValue,
  6. EdgeInsets expandedHeaderPadding = _kPanelHeaderExpandedDefaultPadding,
  7. Color? dividerColor,
  8. double elevation = 2}

Creates a radio expansion panel list widget.

This widget allows for at most one panel in the list to be open. The expansion panel callback is triggered when an expansion panel expand/collapse button is pushed. The children and animationDuration arguments must not be null. The children objects must be instances of ExpansionPanelRadio.

Here is a simple example of how to implement ExpansionPanelList.radio.

To create a local project with this code sample, run:
flutter create --sample=material.ExpansionPanelList.radio.1 mysample


const ExpansionPanelList.radio({
  this.children = const <ExpansionPanelRadio>[],
  this.animationDuration = kThemeAnimationDuration,
  this.expandedHeaderPadding = _kPanelHeaderExpandedDefaultPadding,
  this.elevation = 2,
}) : assert(children != null),
     assert(animationDuration != null),
     _allowOnlyOnePanelOpen = true;