morphable_shape
library
Classes
AnimatedDecoratedShadowedShape
An implicitly animated version of the DecoratedShadowedShape widget
AnimatedDimensionSizedBox
ArcShapeBorder
A rectangle with one side replaced by an arc with a certain height
ArrowShapeBorder
An arrow shape with a head and a tail
BubbleShapeBorder
Bubble shape, with a triangular tip and equal radius rounded corner
The corner parameter is where the tip calculates its positions
CircleShapeBorder
Circle shape
ClipPathInsetShadow
ClipPathShadow
CustomShapeBorderClipper
A widget that contains a decoration, shadows, inset shadows and clipped by a shape border
DecoratedShadowedShape
Dimension
Base class of Dimension. Convert to actual px value by calling
the toPX() function and provide a constraint value and the screen size.
DimensionSizedBox
Creates a widget that sizes its child to two possible Dimension values
If this widget is placed in a infinite constraint environment and either the width
or height has percent unit, the constraint is clamped to the size of the screen.
DimensionTween
DynamicBorderRadius
DynamicBorderSide
An enhanced BorderSide class.
Supports gradient, different strokeJoin and strokeCap
Also supports partial drawing by changing the begin, end, and shift
DynamicNode
A single point with two possible control points
DynamicOffset
An offset with two Dimension instance
DynamicPath
A Bezier path with either straight line or cubic Bezier line
This is the key component of this package, especially for morphing
Instead of constructing a Path object directly like others do, we construct a DynamicPath
instead, which remembers all its control points.
DynamicPathMorph
Class for controlling the morphing of two shapes
what it does basically is try to make the two shape having the
same number of control points.
DynamicRadius
FilledBorderShapeBorder
Shape with multiple border color and width, use PaintingStyle.fill
to paint the border
Length
This is the one actually used by users.
Contains a value and a unit
ListShapeShadowTween
MorphableShapeBorder
The base class for various shape borders implemented in this package
should be serializable/deserializable
generate a DynamicPath instance with all the control points, then convert to a Path
MorphableShapeBorderTween
Why is there no shapeTween?
Because to morph shape we need to know the rect at every time step,
which can only be retrieved from a shapeBorder
MorphShapeData
Data class associated with a MorphableShapeTween
supplyCounts are used to make two dynamic paths becoming equal length, they are
initialized when the morphing first starts and does not change afterwards
even if the bounding box changes size.
OutlinedShapeBorder
Shape with a single border color and width, use PaintingStyle.stroke
to paint the border
PathShapeBorder
A Shape made from a path with straight or cubic Bezier lines
possible for future implementation of freeform lines or import shapes from SVG
PolygonShapeBorder
Polygon shape with different number of sides, corner radius and corner style
RectangleBorderSides
RectangleCornerStyles
classes for configuring the border and corner of a rectangle
RectangleShapeBorder
Rectangle shape with various corner style and radius for each corner
RenderDimensionSizedBox
RoundedRectangleShapeBorder
Rectangle shape with various border radius and width for each corner
This class is similar to what CSS box does, you can configure different border
radius and border width
ShapeShadow
StarShapeBorder
Star shape, with different corner radius & style, inset radius & style.
TrapezoidShapeBorder
A trapezoid shape
TriangleShapeBorder
triangle shape defined by the three vertices
Constants
lengthUnitMap
→ const Map <String , LengthUnit >
presetCircleShapeMap
→ const Map <String , MorphableShapeBorder >
presetOtherShapeMap
→ const Map <String , MorphableShapeBorder >
presetPolygonShapeMap
→ const Map <String , MorphableShapeBorder >
presetRectangleShapeMap
→ const Map <String , MorphableShapeBorder >
presetRoundedRectangleShapeMap
→ const Map <String , MorphableShapeBorder >
presetShapeMap
→ const Map <String , Map <String , MorphableShapeBorder > >
A collection of predefined shapes, grouped into maps
presetStarShapeMap
→ const Map <String , MorphableShapeBorder >
presetTriangleShapeMap
→ const Map <String , MorphableShapeBorder >
Functions
arcToCubicBezier (Rect rect , double startAngle , double sweepAngle , {double limit = pi / 4 , int ? splitTimes })
→ List <Offset >
recursively split an arc into multiple cubic Bezier
gcd (int a , int b )
→ int
getDerivativeOnArc (Rect rect , double t )
→ Offset
getPointOnArc (Rect rect , double t )
→ Offset
get point coordinate/first derivative at parameter t on an arc
getThirdAngle (double a , double b , double c )
→ double
getThirdSideLength (double a , double b , double angle )
→ double
get third angle or side length in a triangle
lcm (int a , int b )
→ int
parseCornerStyle (String ? string )
→ CornerStyle ?
parseDimension (dynamic input )
→ Dimension ?
parseDynamicBorderRadius (Map <String , dynamic > ? map )
→ DynamicBorderRadius ?
parseDynamicBorderSide (Map <String , dynamic > ? map )
→ DynamicBorderSide ?
parseDynamicOffset (Map <String , dynamic > ? map )
→ DynamicOffset ?
parseDynamicPath (Map <String , dynamic > ? map )
→ DynamicPath ?
parseDynamicRadius (Map <String , dynamic > ? map )
→ DynamicRadius ?
parseLength (String ? string )
→ Length ?
parseLengthUnit (String ? unit )
→ LengthUnit ?
parseMorphableShapeBorder (Map <String , dynamic > ? map )
→ MorphableShapeBorder ?
parseRectangleBorderSide (Map <String , dynamic > ? map )
→ RectangleBorderSides ?
parseRectangleCornerStyle (Map <String , dynamic > ? map )
→ RectangleCornerStyles ?
parseShapeShadow (Map <String , dynamic > ? map )
→ ShapeShadow ?
parseShapeSide (String ? string )
→ ShapeSide ?
rotateList (List list , int v )
→ List