Skip to main content

MaybeWidgetStateProperty

Trait MaybeWidgetStateProperty 

Source
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§

Source

fn as_widget_state_property(&self) -> Option<&dyn WidgetStateProperty<T>>

The property this value is, if it is one.

Source

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.

Source§

impl MaybeWidgetStateProperty<Option<OutlinedBorderRef>> for Option<OutlinedBorderRef>

Dart’s T? is OutlinedBorder?: a WidgetStateOutlinedBorder resolves to an optional border.

Source§

impl MaybeWidgetStateProperty<Rc<dyn MouseCursor>> for MouseCursorRef

Source§

impl<T, V: MaybeWidgetStateProperty<T>> MaybeWidgetStateProperty<T> for Option<V>

Implementors§