pub struct ButtonSegment<T> {
pub value: T,
pub icon: Option<WidgetRef>,
pub label: Option<WidgetRef>,
pub tooltip: Option<String>,
pub enabled: bool,
}Expand description
Data describing a segment of a SegmentedButton.
Two segments are equal when their fields are: their widgets by identity. Where Dart compares
two segments by identity, a SegmentedButton matches the segments of a rebuild by
value, which must be unique.
Fields§
§value: TValue used to identify the segment.
This value must be unique across all segments in a SegmentedButton.
icon: Option<WidgetRef>Optional icon displayed in the segment.
label: Option<WidgetRef>Optional label displayed in the segment.
tooltip: Option<String>Optional tooltip for the segment
enabled: boolDetermines if the segment is available for selection.
Implementations§
Source§impl<T> ButtonSegment<T>
impl<T> ButtonSegment<T>
Sourcepub fn new(value: T) -> ButtonSegment<T>
pub fn new(value: T) -> ButtonSegment<T>
Construct a ButtonSegment.
One of icon or label must be non-null, which
SegmentedButton asserts when it is built into a widget.
Sourcepub fn icon<K>(self, icon: impl IntoWidget<K>) -> ButtonSegment<T>
pub fn icon<K>(self, icon: impl IntoWidget<K>) -> ButtonSegment<T>
Dart ButtonSegment(icon:).
Sourcepub fn label<K>(self, label: impl IntoWidget<K>) -> ButtonSegment<T>
pub fn label<K>(self, label: impl IntoWidget<K>) -> ButtonSegment<T>
Dart ButtonSegment(label:).
Sourcepub fn tooltip(self, tooltip: impl Into<String>) -> ButtonSegment<T>
pub fn tooltip(self, tooltip: impl Into<String>) -> ButtonSegment<T>
Dart ButtonSegment(tooltip:).
Sourcepub fn enabled(self, enabled: bool) -> ButtonSegment<T>
pub fn enabled(self, enabled: bool) -> ButtonSegment<T>
Dart ButtonSegment(enabled:).