ExpansionPanel constructor Null safety

ExpansionPanel(
  1. {required ExpansionPanelHeaderBuilder headerBuilder,
  2. required Widget body,
  3. bool isExpanded = false,
  4. bool canTapOnHeader = false,
  5. Color? backgroundColor}
)

Creates an expansion panel to be used as a child for ExpansionPanelList. See ExpansionPanelList for an example on how to use this widget.

The headerBuilder, body, and isExpanded arguments must not be null.

Implementation

ExpansionPanel({
  required this.headerBuilder,
  required this.body,
  this.isExpanded = false,
  this.canTapOnHeader = false,
  this.backgroundColor,
}) : assert(headerBuilder != null),
     assert(body != null),
     assert(isExpanded != null),
     assert(canTapOnHeader != null);