ListButtonWidth enum

Enum that specifies how a ListButton will calculate its width.

Inheritance

Constructors

ListButtonWidth()
const

Values

shrinkWrapCurrentItem → const ListButtonWidth

Specification of ListButton width that causes the button to adopt the intrinsic width of the currently selected item.

This specification will cause the button width to change as different items are selected, if those items have different intrinsic widths.

Along with expand, this specification is the fastest in runtime efficiency because it doesn't need to pre-calculate the intrinsic widths of the list button's items.

shrinkWrapAllItems → const ListButtonWidth

Specification of ListButton width that causes the button to adopt the largest intrinsic width of all the button's items.

This specification will yield a stable button width. As the selected item changes, the button width will always be at least as wide as it needs to be, sometimes wider.

This specification is relatively expensive in runtime efficiency, because it requires pre-calculating the unconstrained widths of the list button's items.

This will cause the list button's ListButton.builder to be invoked for every one of the button's list items in order to measure their widths. The list button element will be passed as the build context. When this measurement is taken, the widgets will be rendered in a synthetic widget tree that doesn't contain the normal application widget ancestry. If any of those widgets depend on inherited widgets in their ancestry, this measurement will fail.

expand → const ListButtonWidth

Specification of ListButton width that causes the button to adopt the widest possible width given the constraints passed to the list button.

This specification will cause the button width to remain stable as long as the input constraints remain stable.

Along with shrinkWrapCurrentItem, this specification is the fastest in runtime efficiency because it doesn't need to pre-calculate the intrinsic widths of the list button's items.

Properties

hashCode int
The hash code for this object.
no setterinherited
index int
A numeric identifier for the enumerated value.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

values → const List<ListButtonWidth>
A constant List of the values in this enum, in order of their declaration.