pub struct OutlineInputBorder {
pub border_side: BorderSide,
pub gap_padding: f64,
pub border_radius: BorderRadius,
}Expand description
Draws a rounded rectangle around an InputDecorator’s container.
When the input decorator’s label is floating, for example because its input child has the focus, the label appears in a gap in the border outline.
The input decorator’s “container” is the optionally filled area above the decorator’s helper, error, and counter.
See also:
UnderlineInputBorder, the defaultInputDecoratorborder which draws a horizontal line at the bottom of the input decorator’s container.ShapedInputBorder, anInputDecoratorborder which draws a customShapeBorderaround the input decorator’s container.InputDecoration, which is used to configure anInputDecorator.
Fields§
§border_side: BorderSideDefines the border line’s color and weight.
gap_padding: f64Horizontal padding on either side of the border’s
InputDecoration.labelText width gap.
This value is used by the paint method to compute the actual
gap width.
border_radius: BorderRadiusThe radii of the border’s rounded rectangle corners.
The corner radii must be circular, i.e. their Radius::x and Radius::y
values must be the same.
Implementations§
Source§impl OutlineInputBorder
impl OutlineInputBorder
Sourcepub fn new() -> OutlineInputBorder
pub fn new() -> OutlineInputBorder
Creates a rounded rectangle outline border for an InputDecorator, with Dart’s
defaults.
Sourcepub fn border_side(self, border_side: BorderSide) -> OutlineInputBorder
pub fn border_side(self, border_side: BorderSide) -> OutlineInputBorder
Dart OutlineInputBorder(borderSide:).
Sourcepub fn border_radius(self, border_radius: BorderRadius) -> OutlineInputBorder
pub fn border_radius(self, border_radius: BorderRadius) -> OutlineInputBorder
Dart OutlineInputBorder(borderRadius:).
Sourcepub fn gap_padding(self, gap_padding: f64) -> OutlineInputBorder
pub fn gap_padding(self, gap_padding: f64) -> OutlineInputBorder
Dart OutlineInputBorder(gapPadding:).
Sourcepub fn copy_with(
&self,
border_side: Option<BorderSide>,
border_radius: Option<BorderRadius>,
gap_padding: Option<f64>,
) -> OutlineInputBorder
pub fn copy_with( &self, border_side: Option<BorderSide>, border_radius: Option<BorderRadius>, gap_padding: Option<f64>, ) -> OutlineInputBorder
Creates a copy of this border with the given fields replaced.
Sourcepub fn scale(&self, t: f64) -> OutlineInputBorder
pub fn scale(&self, t: f64) -> OutlineInputBorder
Creates a copy of this border, scaled by the factor t.
Trait Implementations§
Source§impl Clone for OutlineInputBorder
impl Clone for OutlineInputBorder
impl Copy for OutlineInputBorder
Source§impl Debug for OutlineInputBorder
impl Debug for OutlineInputBorder
Source§impl Default for OutlineInputBorder
impl Default for OutlineInputBorder
Source§fn default() -> OutlineInputBorder
fn default() -> OutlineInputBorder
Creates a rounded rectangle outline border for an InputDecorator.
If the border_side parameter is BorderSide::NONE, it will not
draw a border. However, it will still define a shape (which you can see if
InputDecoration.filled is true).
If an application does not specify a border_side parameter of
value BorderSide::NONE, the input decorator substitutes its own, using
copy_with, based on the current theme and InputDecorator.isFocused.
The border_radius parameter defaults to a value where all four
corners have a circular radius of 4.0. The corner radii must be circular, i.e.
their Radius::x and Radius::y values must be the same.
See also:
InputDecoration.floatingLabelBehavior, which should be set toFloatingLabelBehavior.neverwhen theborder_sideisBorderSide::NONE. If left asFloatingLabelBehavior.auto, the label will extend beyond the container as if the border were still being drawn.
Source§impl InputBorder for OutlineInputBorder
impl InputBorder for OutlineInputBorder
Source§fn paint(
&self,
canvas: &mut Canvas,
rect: Rect,
gap_start: Option<f64>,
gap_extent: f64,
gap_percentage: f64,
text_direction: Option<TextDirection>,
)
fn paint( &self, canvas: &mut Canvas, rect: Rect, gap_start: Option<f64>, gap_extent: f64, gap_percentage: f64, text_direction: Option<TextDirection>, )
Draw a rounded rectangle around rect using
border_radius.
The border_side defines the line’s color and
weight.
The top side of the rounded rectangle may be interrupted by a single gap
if gap_extent is non-null. In that case the gap begins at
gap_start - gap_padding (assuming that the text_direction is TextDirection::Ltr).
The gap’s width is (gap_padding + gap_extent + gap_padding) * gap_percentage.
Source§fn border_side(&self) -> BorderSide
fn border_side(&self) -> BorderSide
Source§fn copy_with(&self, border_side: Option<BorderSide>) -> InputBorderRef
fn copy_with(&self, border_side: Option<BorderSide>) -> InputBorderRef
border_side.Source§fn is_outline(&self) -> bool
fn is_outline(&self) -> bool
InputDecorator’s container. Read moreSource§fn as_widget_state_property(
&self,
) -> Option<&dyn WidgetStateProperty<InputBorderRef>>
fn as_widget_state_property( &self, ) -> Option<&dyn WidgetStateProperty<InputBorderRef>>
border is WidgetStateProperty<InputBorder>: this border as the property it
also is, for the borders that implement WidgetStateProperty (WidgetStateInputBorder
and the deprecated MaterialState input borders).Source§impl PartialEq for OutlineInputBorder
impl PartialEq for OutlineInputBorder
Source§impl ShapeBorder for OutlineInputBorder
impl ShapeBorder for OutlineInputBorder
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_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 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 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 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 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 as_outlined_border(&self) -> Option<&(dyn OutlinedBorder + 'static)>
fn as_outlined_border(&self) -> Option<&(dyn OutlinedBorder + 'static)>
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 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.