ShapeOutline class final
The geometry of a shape, or of a surface inside one: a rectangle, an ellipse or a path computed from the frame size and the shape's values.
A shape's outline is its painted surface, its hit area and where connectors meet it; its fill and stroke are editable, and so is its corner radius when the outline rounds its corners. A shape without an outline paints no surface of its own and is picked by its frame.
Constructors
- ShapeOutline.editablePath({String valueKey = 'path', bool cornerRadius = true})
-
The path each instance stores in the PathValueField
valueKey, in unit coordinates, edited point by point.factory - ShapeOutline.ellipse()
-
An ellipse filling the frame.
const
- ShapeOutline.ink({String valueKey = 'ink'})
-
A freehand stroke: the InkValueField
valueKey, drawn with the style's stroke width and ink preset.const - ShapeOutline.normalized(DiagramVectorPath path, {bool cornerRadius = false})
-
A fixed path in unit coordinates, scaled to the frame.
factory
- ShapeOutline.path(ShapePathBuilder path, {bool cornerRadius = false, String? valueKey})
-
A path computed by
pathfrom the frame size and the shape's values, its straight corners rounded by the style's corner radius whencornerRadius. A closed, straight-edged path resolves as a polygon.const -
ShapeOutline.polygon(List<
DiagramPoint> points) -
A fixed polygon through
pointsin unit coordinates.factory - ShapeOutline.rect({bool cornerRadius = true})
-
A rectangle, rounded by the style's corner radius when
cornerRadius.const - ShapeOutline.regularPolygon({String valueKey = 'sides'})
-
A regular polygon whose side count is the integer value
valueKey, declared with sidesField. Its corners follow the style's radius.factory
Properties
- cornerRadius → bool
-
Whether the style's corner radius rounds this outline, and so is
editable.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isInk → bool
-
Whether this outline is a freehand stroke rather than a contour.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- valueKey → String?
-
The value instances edit to reshape this outline, if any.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pathValueIn(
Map< String, ValueField> fields) → String? - The PathValueField an editablePath edits, else null.
-
resolve(
DiagramRect frame, ShapeStyle style, Map< String, Object?> values) → ResolvedOutline -
This outline at
frame, for a shape or surface withstyleandvalues. -
sidesValueIn(
Map< String, ValueField> fields) → String? - The integer side-count value of a regularPolygon, else null.
-
toString(
) → String -
A string representation of this object.
inherited
-
vectorPathAt(
DiagramRect frame, ShapeStyle style, Map< String, Object?> values) → VectorPathOutline -
This path outline at
framewith its nodes kept, even when it resolves as a polygon, for editing it point by point.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
sidesField(
int defaultValue) → NumberValueField - A regular polygon's side count: an integer between 3 and 20.
Constants
- maximumSides → const int
- minimumSides → const int