Catmull-Rom Curve
Platform Support
Android | iOS | MacOS | Web | Linux | Windows |
---|---|---|---|---|---|
✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Features
Now You can Draw Fitted Curves easily just using points Offsets.
Screenshot
Getting started
using CatmullCurve.drawCurve() Function that will return a CustomPaint waiting to be placed inside your Constrained Sized Widget
Constraints
Required : -List of Offset "points of the curve", -Color "Curve color" -double "Curve Stroke Width" -PaintingStyle "Define Curve Style",
Optional : -bool drawPoints "If you want to draw the points of your curve, Set this to true" -double? pointsStrokeWidth "Specify the stroke width of your points, Default set to 2x Curve Stroke Width " -Color pointcolor "Specify the points color, Default set to Red"
Usage
1 - Import the Package "import 'package:catmull_rom_spline_curve/catmull_rom_spline_curve.dart';"
2- Inside your Constrained Sized Widget, Call the function CatmullCurve.drawCurve() With the corresponding parameters
3- Voila!
SizedBox(
width: 200,
height: 200,
child: CatmullCurve.drawCurve(
[
Offset(0, 200),
Offset(20, 50),
Offset(30, 200),
],
Colors.red,
2,
PaintingStyle.stroke,
pointcolor: Colors.blue,
drawPoints: true,
pointsStrokeWidth: 8,
),
),