CircleBorder class

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.


CircleBorder({BorderSide side = BorderSide.none, double eccentricity = 0.0})
Create a circle border.


dimensions EdgeInsetsGeometry
The widths of the sides of this border represented as an EdgeInsets.
no setterinherited
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.
hashCode int
The hash code for this object.
no setteroverride
preferPaintInterior bool
Reports whether paintInterior is implemented.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
side BorderSide
The border outline's color and weight.


add(ShapeBorder other, {bool reversed = false}) ShapeBorder?
Attempts to create a new object that represents the amalgamation of this border and the other border.
copyWith({BorderSide? side, double? eccentricity}) CircleBorder
Returns a copy of this OutlinedBorder that draws its outline with the specified side, if side is non-null.
getInnerPath(Rect rect, {TextDirection? textDirection}) Path
Create a Path that describes the inner edge of the border.
getOuterPath(Rect rect, {TextDirection? textDirection}) Path
Create a Path that describes the outer edge of the border.
lerpFrom(ShapeBorder? a, double t) ShapeBorder?
Linearly interpolates from another ShapeBorder (possibly of another class) to this.
lerpTo(ShapeBorder? b, double t) ShapeBorder?
Linearly interpolates from this to another ShapeBorder (possibly of another class).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
paint(Canvas canvas, Rect rect, {TextDirection? textDirection}) → void
Paints the border within the given Rect on the given Canvas.
paintInterior(Canvas canvas, Rect rect, Paint paint, {TextDirection? textDirection}) → void
Paint a canvas with the appropriate shape.
scale(double t) ShapeBorder
Creates a copy of this border, scaled by the factor t.
toString() String
A string representation of this object.


operator +(ShapeBorder other) ShapeBorder
Creates a new border consisting of the two borders on either side of the operator.
operator ==(Object other) bool
The equality operator.