CircleBorder class Null safety
A border that fits a circle within the available space.
Typically used with ShapeDecoration to draw a circle.
The dimensions assume that the border is being used in a square space. When applied to a rectangular space, the border paints in the center of the rectangle.
The eccentricity parameter describes how much a circle will deform to fit the rectangle it is a border for. A value of zero implies no deformation (a circle touching at least two sides of the rectangle), a value of one implies full deformation (an oval touching all sides of the rectangle).
See also:
- OvalBorder, which draws a Circle touching all the edges of the box.
- BorderSide, which is used to describe each side of the box.
- Border, which, when used with BoxDecoration, can also describe a circle.
- Inheritance
-
- Object
- ShapeBorder
- OutlinedBorder
- CircleBorder
- Implementers
Constructors
- CircleBorder({BorderSide side = BorderSide.none, double eccentricity = 0.0})
-
Create a circle border.
const
Properties
- dimensions → EdgeInsetsGeometry
-
The widths of the sides of this border represented as an EdgeInsets.
read-onlyoverride
- eccentricity → double
-
Defines the ratio (0.0-1.0) from which the border will deform
to fit a rectangle.
When 0.0, it draws a circle touching at least two sides of the rectangle.
When 1.0, it draws an oval touching all sides of the rectangle.
final
- hashCode → int
-
The hash code for this object.
read-onlyoverride
- runtimeType → Type
-
A representation of the runtime type of the object.
read-onlyinherited
- side → BorderSide
-
The border outline's color and weight.
finalinherited
Methods
-
add(
ShapeBorder other, {bool reversed = false}) → ShapeBorder? -
Attempts to create a new object that represents the amalgamation of
this
border and theother
border.protected">@protectedinherited -
copyWith(
{BorderSide? side, double? eccentricity}) → CircleBorder -
Returns a copy of this OutlinedBorder that draws its outline with the
specified
side
, ifside
is non-null.override -
getInnerPath(
Rect rect, {TextDirection? textDirection}) → Path -
Create a Path that describes the inner edge of the border.
override
-
getOuterPath(
Rect rect, {TextDirection? textDirection}) → Path -
Create a Path that describes the outer edge of the border.
override
-
lerpFrom(
ShapeBorder? a, double t) → ShapeBorder? -
Linearly interpolates from another ShapeBorder (possibly of another
class) to
this
.override -
lerpTo(
ShapeBorder? b, double t) → ShapeBorder? -
Linearly interpolates from
this
to another ShapeBorder (possibly of another class).override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited
-
paint(
Canvas canvas, Rect rect, {TextDirection? textDirection}) → void -
Paints the border within the given Rect on the given Canvas.
override
-
scale(
double t) → ShapeBorder -
Creates a copy of this border, scaled by the factor
t
.override -
toString(
) → String -
A string representation of this object.
override
Operators
-
operator +(
ShapeBorder other) → ShapeBorder -
Creates a new border consisting of the two borders on either side of the
operator.
inherited
-
operator ==(
Object other) → bool -
The equality operator.
override