Skip to main content

ExpansionPanelList

Struct ExpansionPanelList 

Source
pub struct ExpansionPanelList {
    pub key: Option<KeyRef>,
    pub children: Vec<ExpansionPanel>,
    pub expansion_callback: Option<ExpansionPanelCallback>,
    pub animation_duration: Duration,
    pub initial_open_panel_value: Option<Rc<dyn AnyEq>>,
    pub expanded_header_padding: EdgeInsets,
    pub divider_color: Option<Color>,
    pub elevation: f64,
    pub expand_icon_color: Option<Color>,
    pub material_gap_size: f64,
    /* private fields */
}
Expand description

A material expansion panel list that lays out its children and animates expansions.

The expansion_callback is called when the expansion state changes. For normal ExpansionPanelList widgets, it is the responsibility of the parent widget to rebuild the ExpansionPanelList with updated values for ExpansionPanel::is_expanded. For ExpansionPanelList::radio widgets, the open state is tracked internally and the callback is invoked both for the previously open panel, which is closing, and the previously closed panel, which is opening.

Fields§

§key: Option<KeyRef>§children: Vec<ExpansionPanel>

The children of the expansion panel list. They are laid out in a similar fashion to ListBody.

§expansion_callback: Option<ExpansionPanelCallback>

The callback that gets called whenever one of the expand/collapse buttons is pressed. The arguments passed to the callback are the index of the pressed panel and whether the panel is currently expanded or not.

§animation_duration: Duration

The duration of the expansion animation.

§initial_open_panel_value: Option<Rc<dyn AnyEq>>

The value of the panel that initially begins open. (This value is only used when initializing with the ExpansionPanelList::radio constructor.)

§expanded_header_padding: EdgeInsets

The padding that surrounds the panel header when expanded.

By default, 16px of space is added to the header vertically (above and below) during expansion.

§divider_color: Option<Color>

Defines color for the divider when ExpansionPanel::is_expanded is false.

If divider_color is None, then DividerThemeData::color is used. If that is None, then ThemeData::divider_color is used.

§elevation: f64

Defines elevation for the ExpansionPanel while it’s expanded.

By default, the value of elevation is 2.

§expand_icon_color: Option<Color>

The color of the icon. Defaults to Colors::BLACK54 when the theme’s brightness is light and to Colors::WHITE60 when it is dark.

§material_gap_size: f64

Defines the MaterialGap::size of the gap between panels when expanded.

Defaults to 16.0.

Implementations§

Source§

impl ExpansionPanelList

Source

pub fn new() -> ExpansionPanelList

Creates an expansion panel list widget. The expansion_callback is triggered when an expansion panel expand/collapse button is pushed; Dart’s optional named arguments are the setters.

Source

pub fn radio( children: impl IntoIterator<Item = ExpansionPanelRadio>, ) -> ExpansionPanelList

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 are radio panels, each with a unique value.

Source

pub fn key(self, key: KeyRef) -> ExpansionPanelList

Dart ExpansionPanelList(key:).

Source

pub fn children( self, children: impl IntoIterator<Item = ExpansionPanel>, ) -> ExpansionPanelList

Dart ExpansionPanelList(children:).

Source

pub fn expansion_callback( self, expansion_callback: ExpansionPanelCallback, ) -> ExpansionPanelList

Dart ExpansionPanelList(expansionCallback:).

Source

pub fn animation_duration( self, animation_duration: Duration, ) -> ExpansionPanelList

Dart ExpansionPanelList(animationDuration:).

Source

pub fn initial_open_panel_value(self, value: impl AnyEq) -> ExpansionPanelList

Dart ExpansionPanelList.radio(initialOpenPanelValue:).

Source

pub fn expanded_header_padding( self, expanded_header_padding: EdgeInsets, ) -> ExpansionPanelList

Dart ExpansionPanelList(expandedHeaderPadding:).

Source

pub fn divider_color(self, divider_color: Color) -> ExpansionPanelList

Dart ExpansionPanelList(dividerColor:).

Source

pub fn elevation(self, elevation: f64) -> ExpansionPanelList

Dart ExpansionPanelList(elevation:).

Source

pub fn expand_icon_color(self, expand_icon_color: Color) -> ExpansionPanelList

Dart ExpansionPanelList(expandIconColor:).

Source

pub fn material_gap_size(self, material_gap_size: f64) -> ExpansionPanelList

Dart ExpansionPanelList(materialGapSize:).

Trait Implementations§

Source§

impl Debug for ExpansionPanelList

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ExpansionPanelList

Source§

fn default() -> ExpansionPanelList

Returns the “default value” for a type. Read more
Source§

impl StatefulWidget for ExpansionPanelList

Source§

type State = ExpansionPanelListState

The state this widget creates.
Source§

fn key(&self) -> Option<&KeyRef>

Source§

fn create_state(&self) -> ExpansionPanelListState

Creates the mutable state for this widget at a given location in the tree. Read more
Source§

fn debug_fill_properties( &self, _app: &App, properties: &mut DiagnosticPropertiesBuilder, )

Dart’s debugFillProperties: the properties a dump shows for this widget, in Dart’s order. Dart’s Widget base only sets the dense tree style, which the framework does.
Source§

fn debug_check_constructor(&self)

Source§

fn as_preferred_size_widget( &self, ) -> Option<&(dyn PreferredSizeWidget + 'static)>

Source§

fn type_name(&self) -> &'static str

See Widget::type_name. A stateful form another widget kind becomes (an animated or status transition widget) names the widget it wraps.

Auto Trait Implementations§

§

impl !RefUnwindSafe for ExpansionPanelList

§

impl !Send for ExpansionPanelList

§

impl !Sync for ExpansionPanelList

§

impl !UnwindSafe for ExpansionPanelList

§

impl Forget for ExpansionPanelList

§

impl Freeze for ExpansionPanelList
where *const RcInner<dyn Key> is !null: Freeze, PhantomData<RcInner<dyn Key>>: Freeze, *const u8 is !null: Freeze, PhantomData<ExpansionPanel>: Freeze, *const RcInner<dyn Fn(&mut App, usize, bool)> is !null: Freeze, PhantomData<RcInner<dyn Fn(&mut App, usize, bool)>>: Freeze, PhantomData<Rc<dyn AnyEq>>: Freeze, *const RcInner<dyn AnyEq> is !null: Freeze, PhantomData<RcInner<dyn AnyEq>>: Freeze,

§

impl Move for ExpansionPanelList

§

impl Unpin for ExpansionPanelList
where Rc<dyn Key>: Unpin, *const u8 is !null: Unpin, Rc<dyn Fn(&mut App, AnyElement, bool) -> Rc<dyn Widget>>: Unpin, Rc<dyn Widget>: Unpin, Rc<dyn Fn(&mut App, usize, bool)>: Unpin, Rc<dyn AnyEq>: Unpin,

§

impl UnsafeUnpin for ExpansionPanelList
where *const RcInner<dyn Key> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Key>>: UnsafeUnpin, *const u8 is !null: UnsafeUnpin, PhantomData<ExpansionPanel>: UnsafeUnpin, *const RcInner<dyn Fn(&mut App, usize, bool)> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(&mut App, usize, bool)>>: UnsafeUnpin, PhantomData<Rc<dyn AnyEq>>: UnsafeUnpin, *const RcInner<dyn AnyEq> is !null: UnsafeUnpin, PhantomData<RcInner<dyn AnyEq>>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<W> IntoWidget<StatefulKind> for W
where W: StatefulWidget,

Source§

fn into_widget(self) -> Rc<dyn Widget>

The widget as a tree node, made where this is called: its creation_location.
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>