pub struct AnyBorderSide { /* private fields */ }Expand description
A BorderSide that may be an instance of a BorderSide subclass, as AnyColor is
for Color.
The framework stores this wherever Flutter stores a BorderSide that may be a subclass
(WidgetStateBorderSide). The plain value is the one the subclass passed to super, reached
by value or by deref; the subclass is recovered with
extension, Dart’s is check.
Equality follows Dart’s: two plain values compare by value, two extended ones by value
and by the subclass’s ==, and a plain value never equals an extended one.
Implementations§
Source§impl AnyBorderSide
impl AnyBorderSide
Sourcepub fn new(value: BorderSide) -> AnyBorderSide
pub fn new(value: BorderSide) -> AnyBorderSide
A plain value.
A subclass instance: value is what it passed to super.
Sourcepub fn value(&self) -> &BorderSide
pub fn value(&self) -> &BorderSide
The plain value: the subclass’s super value.
Sourcepub fn extension<E>(&self) -> Option<&E>where
E: BorderSideExtension,
pub fn extension<E>(&self) -> Option<&E>where
E: BorderSideExtension,
Dart’s value is T: the subclass instance, if this value is one.
Sourcepub fn has_extension(&self) -> bool
pub fn has_extension(&self) -> bool
Whether this value is a subclass instance.
Methods from Deref<Target = BorderSide>§
Sourcepub fn copy_with(
&self,
color: Option<Color>,
width: Option<f64>,
style: Option<BorderStyle>,
stroke_align: Option<f64>,
) -> BorderSide
pub fn copy_with( &self, color: Option<Color>, width: Option<f64>, style: Option<BorderStyle>, stroke_align: Option<f64>, ) -> BorderSide
Creates a copy of this border but with the given fields replaced with the new values.
Sourcepub fn scale(&self, t: f64) -> BorderSide
pub fn scale(&self, t: f64) -> BorderSide
Creates a copy of this border side description but with the width scaled
by the factor t.
Since a zero width is normally painted as a hairline width rather than no
border at all, the zero factor is special-cased to instead change the
style to BorderStyle::None.
Negative values are treated like zero.
Sourcepub fn to_paint(&self) -> Paint
pub fn to_paint(&self) -> Paint
Create a Paint object that, if used to stroke a line, will draw the
line in this border’s style.
The stroke_align property is not reflected in the
Paint; consumers must implement that directly by inflating or
deflating their region appropriately.
Sourcepub fn stroke_inset(&self) -> f64
pub fn stroke_inset(&self) -> f64
Get the amount of the stroke width that lies inside of the BorderSide.
Sourcepub fn stroke_outset(&self) -> f64
pub fn stroke_outset(&self) -> f64
Get the amount of the stroke width that lies outside of the BorderSide.
Sourcepub fn stroke_offset(&self) -> f64
pub fn stroke_offset(&self) -> f64
The offset of the stroke, taking into account the stroke alignment.
Trait Implementations§
Source§impl Clone for AnyBorderSide
impl Clone for AnyBorderSide
Source§fn clone(&self) -> AnyBorderSide
fn clone(&self) -> AnyBorderSide
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more