catmull_rom_spline_curve 1.0.0 catmull_rom_spline_curve: ^1.0.0 copied to clipboard
A new Flutter package to help drawing Curves using Catmull-Rom Interpolation.
Catmull-Rom Curve #
Features #
Now You can Draw Fitted Curves easily just using points Offsets.
Getting started #
using CatmullCurve.drawCurve() Function that will return a CustomPaint waiting to be placed inside your Constrained Sized Widget
Constrains #
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 Packacge "import 'package:catmull_rom_spline_curve/catmull_rom_spline_curve.dart';"
2- Inside your Constrained Sized Widget, Call the function CatmullCurve.drawCurve() With the corrosponding 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,
),
),