pub trait MaybeWidgetStateProperty<T>: Clone {
// Required methods
fn as_widget_state_property(&self) -> Option<&dyn WidgetStateProperty<T>>;
fn from_resolved(value: T) -> Self;
}Expand description
A value that may be a WidgetStateProperty in disguise: Dart’s
value is WidgetStateProperty<T> in <dyn WidgetStateProperty<T>>::resolve_as.
AnyColor answers through its WidgetStateColor extension, MouseCursorRef
through as_any, and an Option of either through its content (Dart’s T?).
Required Methods§
Sourcefn as_widget_state_property(&self) -> Option<&dyn WidgetStateProperty<T>>
fn as_widget_state_property(&self) -> Option<&dyn WidgetStateProperty<T>>
The property this value is, if it is one.
Sourcefn from_resolved(value: T) -> Self
fn from_resolved(value: T) -> Self
A resolved value as this type (Dart’s T is both).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl MaybeWidgetStateProperty<Option<BorderSide>> for Option<AnyBorderSide>
Dart’s T? is BorderSide?: a WidgetStateBorderSide resolves to an optional side.
impl MaybeWidgetStateProperty<Option<BorderSide>> for Option<AnyBorderSide>
Dart’s T? is BorderSide?: a WidgetStateBorderSide resolves to an optional side.
fn as_widget_state_property( &self, ) -> Option<&dyn WidgetStateProperty<Option<BorderSide>>>
fn from_resolved(value: Option<BorderSide>) -> Option<AnyBorderSide>
Source§impl MaybeWidgetStateProperty<Option<OutlinedBorderRef>> for Option<OutlinedBorderRef>
Dart’s T? is OutlinedBorder?: a WidgetStateOutlinedBorder resolves to an optional
border.
impl MaybeWidgetStateProperty<Option<OutlinedBorderRef>> for Option<OutlinedBorderRef>
Dart’s T? is OutlinedBorder?: a WidgetStateOutlinedBorder resolves to an optional
border.