CircleShape class

A shape that creates perfect circles with optional border styling.

CircleShape generates geometric paths for circular shapes that are inscribed within the bounding rectangle. The circle's radius is determined by the smaller dimension of the rectangle to ensure the circle fits completely within the bounds.

This shape supports custom border styling through the BorderShape mixin, allowing for outlined circles with configurable border width and color.

Example usage:

// Create a simple circle
CircleShape()

// Create a circle with a colored border
CircleShape(
  borderWidth: 2.0,
  borderColor: Colors.blue,
)
Inheritance
Mixed-in types

Constructors

CircleShape.new({double borderWidth = 0, Color borderColor = Colors.white})
Creates a new CircleShape with optional border styling.

Properties

borderColor Color
The color of the border stroke.
final
borderPaint Paint
Paint object used for drawing the border.
final
borderWidth double
The width of the border stroke around the circle.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

build({Rect? rect, double? scale}) Path
Builds the geometric path for this circle shape.
override
drawBorder(Canvas canvas, Rect rect) → void
Draws a custom border for the circle shape.
override
generatePath({bool? useBezier, required Rect rect}) Path
Generates the actual path for the circle shape.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited