ExpansionPanelList.radio constructor Null safety
- {Key? key,
- List<
ExpansionPanel> children = const <ExpansionPanelRadio>[], - ExpansionPanelCallback? expansionCallback,
- Duration animationDuration = kThemeAnimationDuration,
- Object? initialOpenPanelValue,
- EdgeInsets expandedHeaderPadding = _kPanelHeaderExpandedDefaultPadding,
- Color? dividerColor,
- 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
flutter create --sample=material.ExpansionPanelList.radio.1 mysample
Implementation
const ExpansionPanelList.radio({
super.key,
this.children = const <ExpansionPanelRadio>[],
this.expansionCallback,
this.animationDuration = kThemeAnimationDuration,
this.initialOpenPanelValue,
this.expandedHeaderPadding = _kPanelHeaderExpandedDefaultPadding,
this.dividerColor,
this.elevation = 2,
}) : assert(children != null),
assert(animationDuration != null),
_allowOnlyOnePanelOpen = true;