pub struct ExpansionPanel {
pub header_builder: ExpansionPanelHeaderBuilder,
pub body: WidgetRef,
pub is_expanded: bool,
pub splash_color: Option<Color>,
pub highlight_color: Option<Color>,
pub can_tap_on_header: bool,
pub background_color: Option<Color>,
}Expand description
A material expansion panel. It has a header and a body and can be either expanded or collapsed. The body of the panel is only visible when it is expanded.
Expansion panels are only intended to be used as children for ExpansionPanelList.
Fields§
§header_builder: ExpansionPanelHeaderBuilderThe widget builder that builds the expansion panels’ header.
body: WidgetRefThe body of the expansion panel that’s displayed below the header.
This widget is visible only when the panel is expanded.
is_expanded: boolWhether the panel is expanded.
splash_color: Option<Color>Defines the splash color of the panel if can_tap_on_header
is true, or the splash color of the expand/collapse IconButton if it is false.
highlight_color: Option<Color>Defines the highlight color of the panel if
can_tap_on_header is true, or the highlight color of the
expand/collapse IconButton if it is false.
can_tap_on_header: boolWhether tapping on the panel’s header will expand/collapse it.
background_color: Option<Color>Defines the background color of the panel.
Defaults to ThemeData::card_color.
Implementations§
Source§impl ExpansionPanel
impl ExpansionPanel
Sourcepub fn new<K>(
header_builder: ExpansionPanelHeaderBuilder,
body: impl IntoWidget<K>,
) -> Self
pub fn new<K>( header_builder: ExpansionPanelHeaderBuilder, body: impl IntoWidget<K>, ) -> Self
Creates an expansion panel to be used as a child for ExpansionPanelList; Dart’s
optional named arguments are the setters.
Sourcepub fn is_expanded(self, is_expanded: bool) -> Self
pub fn is_expanded(self, is_expanded: bool) -> Self
Dart ExpansionPanel(isExpanded:).
Sourcepub fn can_tap_on_header(self, can_tap_on_header: bool) -> Self
pub fn can_tap_on_header(self, can_tap_on_header: bool) -> Self
Dart ExpansionPanel(canTapOnHeader:).
Sourcepub fn background_color(self, background_color: Color) -> Self
pub fn background_color(self, background_color: Color) -> Self
Dart ExpansionPanel(backgroundColor:).
Sourcepub fn splash_color(self, splash_color: Color) -> Self
pub fn splash_color(self, splash_color: Color) -> Self
Dart ExpansionPanel(splashColor:).
Sourcepub fn highlight_color(self, highlight_color: Color) -> Self
pub fn highlight_color(self, highlight_color: Color) -> Self
Dart ExpansionPanel(highlightColor:).