pub struct WidgetStateOutlinedBorder { /* private fields */ }Expand description
Defines an OutlinedBorder whose value depends on a set of WidgetStates which
represent the interactive state of a component.
To use a WidgetStateOutlinedBorder, you should create a subclass of a
WidgetStateOutlinedBorder and override the abstract resolve method, or use
WidgetStateOutlinedBorder::resolve_with or WidgetStateOutlinedBorder::from_map.
If a WidgetStateOutlinedBorder is used for a property or a parameter that doesn’t
support resolving WidgetStateProperty<Option<OutlinedBorderRef>>s, then its
default value, Dart’s RoundedRectangleBorder(), will be used for all states.
It is itself an OutlinedBorder, as OutlinedBorder is a trait here: it is recovered
from an OutlinedBorderRef with
border.as_any().downcast_ref::<WidgetStateOutlinedBorder>().
Implementations§
Source§impl WidgetStateOutlinedBorder
impl WidgetStateOutlinedBorder
Sourcepub fn resolve_with(
callback: impl Fn(&WidgetStates) -> Option<OutlinedBorderRef> + 'static,
) -> WidgetStateOutlinedBorder
pub fn resolve_with( callback: impl Fn(&WidgetStates) -> Option<OutlinedBorderRef> + 'static, ) -> WidgetStateOutlinedBorder
Creates a WidgetStateOutlinedBorder from a WidgetPropertyResolver callback
function.
If used as a regular OutlinedBorder, it acts the same as an empty
RoundedRectangleBorder() constructor.
Sourcepub fn from_map(
map: WidgetStateMap<Option<OutlinedBorderRef>>,
) -> WidgetStateOutlinedBorder
pub fn from_map( map: WidgetStateMap<Option<OutlinedBorderRef>>, ) -> WidgetStateOutlinedBorder
Creates a WidgetStateOutlinedBorder 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.
Trait Implementations§
Source§impl Clone for WidgetStateOutlinedBorder
impl Clone for WidgetStateOutlinedBorder
Source§impl Debug for WidgetStateOutlinedBorder
impl Debug for WidgetStateOutlinedBorder
Source§impl OutlinedBorder for WidgetStateOutlinedBorder
impl OutlinedBorder for WidgetStateOutlinedBorder
Source§fn side(&self) -> BorderSide
fn side(&self) -> BorderSide
Source§fn copy_with(&self, side: Option<BorderSide>) -> OutlinedBorderRef
fn copy_with(&self, side: Option<BorderSide>) -> OutlinedBorderRef
OutlinedBorder that draws its outline with the
specified side, if side is Some.Source§impl ShapeBorder for WidgetStateOutlinedBorder
_WidgetStateOutlinedBorder extends RoundedRectangleBorder: every ShapeBorder member is
the default rounded rectangle’s.
impl ShapeBorder for WidgetStateOutlinedBorder
_WidgetStateOutlinedBorder extends RoundedRectangleBorder: every ShapeBorder member is
the default rounded rectangle’s.
Source§fn dimensions(&self) -> EdgeInsetsGeometry
fn dimensions(&self) -> EdgeInsetsGeometry
EdgeInsetsGeometry.Source§fn scale(&self, t: f64) -> ShapeBorderRef
fn scale(&self, t: f64) -> ShapeBorderRef
t.Source§fn lerp_from(
&self,
a: Option<&dyn ShapeBorder>,
t: f64,
) -> Option<ShapeBorderRef>
fn lerp_from( &self, a: Option<&dyn ShapeBorder>, t: f64, ) -> Option<ShapeBorderRef>
Source§fn lerp_to(&self, b: Option<&dyn ShapeBorder>, t: f64) -> Option<ShapeBorderRef>
fn lerp_to(&self, b: Option<&dyn ShapeBorder>, t: f64) -> Option<ShapeBorderRef>
Source§fn get_outer_path(
&self,
rect: Rect,
text_direction: Option<TextDirection>,
) -> Path
fn get_outer_path( &self, rect: Rect, text_direction: Option<TextDirection>, ) -> Path
Path that describes the outer edge of the border.Source§fn get_inner_path(
&self,
rect: Rect,
text_direction: Option<TextDirection>,
) -> Path
fn get_inner_path( &self, rect: Rect, text_direction: Option<TextDirection>, ) -> Path
Path that describes the inner edge of the border.Source§fn hit_test(
&self,
rect: Rect,
position: Offset,
text_direction: Option<TextDirection>,
) -> bool
fn hit_test( &self, rect: Rect, position: Offset, text_direction: Option<TextDirection>, ) -> bool
position.Source§fn paint_interior(
&self,
canvas: &mut Canvas,
rect: Rect,
paint: &Paint,
text_direction: Option<TextDirection>,
)
fn paint_interior( &self, canvas: &mut Canvas, rect: Rect, paint: &Paint, text_direction: Option<TextDirection>, )
Source§fn prefer_paint_interior(&self) -> bool
fn prefer_paint_interior(&self) -> bool
paint_interior is implemented.Source§fn as_outlined_border(&self) -> Option<&dyn OutlinedBorder>
fn as_outlined_border(&self) -> Option<&dyn OutlinedBorder>
OutlinedBorder downcast for Dart’s is OutlinedBorder.Source§fn into_outlined_border(self: Rc<Self>) -> Option<Rc<dyn OutlinedBorder>>
fn into_outlined_border(self: Rc<Self>) -> Option<Rc<dyn OutlinedBorder>>
OutlinedBorder downcast of the shared border, for Dart’s as OutlinedBorder
(ShapeBorderRef::as_outlined_border_ref). An OutlinedBorder answers Some(self),
as it answers as_outlined_border.Source§fn eq_shape(&self, other: &dyn ShapeBorder) -> bool
fn eq_shape(&self, other: &dyn ShapeBorder) -> bool
== is identity; subclasses that override
== implement this.Source§fn add(&self, other: &ShapeBorderRef, reversed: bool) -> Option<ShapeBorderRef>
fn add(&self, other: &ShapeBorderRef, reversed: bool) -> Option<ShapeBorderRef>
this border and the other border. Read moreSource§fn as_box_border(&self) -> Option<&(dyn BoxBorder + 'static)>
fn as_box_border(&self) -> Option<&(dyn BoxBorder + 'static)>
BoxBorder downcast for BoxBorderRef::lerp.Source§fn into_box_border(self: Rc<Self>) -> Option<Rc<dyn BoxBorder>>
fn into_box_border(self: Rc<Self>) -> Option<Rc<dyn BoxBorder>>
BoxBorder downcast of the shared border
(ShapeBorderRef::as_box_border_ref). A box border answers Some(self), as it
answers as_box_border.Source§impl WidgetStateProperty<Option<OutlinedBorderRef>> for WidgetStateOutlinedBorder
impl WidgetStateProperty<Option<OutlinedBorderRef>> for WidgetStateOutlinedBorder
Source§fn resolve(&self, states: &WidgetStates) -> Option<OutlinedBorderRef>
fn resolve(&self, states: &WidgetStates) -> Option<OutlinedBorderRef>
Source§fn as_mapper(&self) -> Option<&WidgetStateMapper<Option<OutlinedBorderRef>>>
fn as_mapper(&self) -> Option<&WidgetStateMapper<Option<OutlinedBorderRef>>>
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<OutlinedBorderRef>>,
) -> bool
fn eq_property( &self, other: &dyn WidgetStateProperty<Option<OutlinedBorderRef>>, ) -> 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.