pub struct WidgetStateBorderSide { /* private fields */ }Expand description
Defines a BorderSide whose value depends on a set of WidgetStates which represent
the interactive state of a component.
To use a WidgetStateBorderSide, you can either:
- Create a subclass of
WidgetStateBorderSideand implement the abstractresolvemethod. - Use
WidgetStateBorderSide::resolve_withand pass in a callback that will be used to resolve the color in the given states. - Use
WidgetStateBorderSide::from_mapto assign a value using aWidgetStateMap.
If a WidgetStateBorderSide is used for a property or a parameter that doesn’t
support resolving WidgetStateProperty<Option<BorderSide>>s, then its default value
will be used for all states.
It is the BorderSide it is in Dart once erased with into_any (or
.into()): an AnyBorderSide whose value is Dart’s super value, the default
BorderSide, and whose extension is this object, recovered with
side.extension::<WidgetStateBorderSide>().
Implementations§
Source§impl WidgetStateBorderSide
impl WidgetStateBorderSide
Sourcepub fn resolve_with(
callback: impl Fn(&WidgetStates) -> Option<BorderSide> + 'static,
) -> WidgetStateBorderSide
pub fn resolve_with( callback: impl Fn(&WidgetStates) -> Option<BorderSide> + 'static, ) -> WidgetStateBorderSide
Creates a WidgetStateBorderSide from a WidgetPropertyResolver<Option<BorderSide>>
callback function.
If used as a regular BorderSide, its behavior matches an empty BorderSide()
constructor.
Sourcepub fn from_map(
map: WidgetStateMap<Option<BorderSide>>,
) -> WidgetStateBorderSide
pub fn from_map( map: WidgetStateMap<Option<BorderSide>>, ) -> WidgetStateBorderSide
Creates a WidgetStateBorderSide from a WidgetStateMap.
This constructor’s resolve method finds the first
entry whose key is satisfied by the set of states, and returns its associated value.
Sourcepub fn into_any(self) -> AnyBorderSide
pub fn into_any(self) -> AnyBorderSide
The side as the BorderSide it is in Dart: the default BorderSide, carrying this
object as the extension.
Sourcepub fn lerp(
a: Option<WidgetStatePropertyRef<Option<BorderSide>>>,
b: Option<WidgetStatePropertyRef<Option<BorderSide>>>,
t: f64,
) -> Option<WidgetStatePropertyRef<Option<BorderSide>>>
pub fn lerp( a: Option<WidgetStatePropertyRef<Option<BorderSide>>>, b: Option<WidgetStatePropertyRef<Option<BorderSide>>>, t: f64, ) -> Option<WidgetStatePropertyRef<Option<BorderSide>>>
Linearly interpolate between two WidgetStatePropertys of BorderSide.
Trait Implementations§
Source§impl BorderSideExtension for WidgetStateBorderSide
impl BorderSideExtension for WidgetStateBorderSide
Source§fn eq_extension(&self, other: &dyn BorderSideExtension) -> bool
fn eq_extension(&self, other: &dyn BorderSideExtension) -> bool
== override on the subclass, called once the values compared equal. other
is the same runtime type when it downcasts; any other type is unequal, as Dart’s
runtimeType check makes it.Source§impl Debug for WidgetStateBorderSide
impl Debug for WidgetStateBorderSide
Source§impl From<WidgetStateBorderSide> for AnyBorderSide
impl From<WidgetStateBorderSide> for AnyBorderSide
Source§fn from(side: WidgetStateBorderSide) -> AnyBorderSide
fn from(side: WidgetStateBorderSide) -> AnyBorderSide
Source§impl WidgetStateProperty<Option<BorderSide>> for WidgetStateBorderSide
impl WidgetStateProperty<Option<BorderSide>> for WidgetStateBorderSide
Source§fn resolve(&self, states: &WidgetStates) -> Option<BorderSide>
fn resolve(&self, states: &WidgetStates) -> Option<BorderSide>
Source§fn as_mapper(&self) -> Option<&WidgetStateMapper<Option<BorderSide>>>
fn as_mapper(&self) -> Option<&WidgetStateMapper<Option<BorderSide>>>
other is WidgetStateMapper<T>: the mapper this property is, if it is one,
as the private mapper subclasses of WidgetStateColor and the rest are.Source§fn eq_property(
&self,
other: &dyn WidgetStateProperty<Option<BorderSide>>,
) -> bool
fn eq_property( &self, other: &dyn WidgetStateProperty<Option<BorderSide>>, ) -> bool
==. Identity unless a class overrides it, as WidgetStatePropertyAll and
WidgetStateMapper do.Source§fn debug_fill_properties(&self, properties: &mut DiagnosticPropertiesBuilder)
fn debug_fill_properties(&self, properties: &mut DiagnosticPropertiesBuilder)
WidgetStateProperty.debugFillProperties, from Diagnosticable: a property
adds its own fields.