Sparkline constructor
Sparkline({
- Key? key,
- required List<
double> data, - double lineWidth = 2.0,
- Color? lineColor = Colors.lightBlue,
- Gradient? lineGradient,
- PointsMode pointsMode = PointsMode.none,
- double pointSize = 4.0,
- Color pointColor = const Color(0xFF0277BD),
- bool sharpCorners = false,
- FillMode fillMode = FillMode.none,
- Color? fillColor = const Color(0xFF81D4FA),
- Gradient? fillGradient,
- double fallbackHeight = 100.0,
- double fallbackWidth = 300.0,
- bool enableGridLines = false,
- Color gridLineColor = Colors.grey,
- int gridLineAmount = 5,
- double gridLineWidth = 0.5,
- Color gridLineLabelColor = Colors.grey,
- String labelPrefix = "\$",
Creates a widget that represents provided data in a Sparkline chart.
Implementation
Sparkline({
Key? key,
required this.data,
this.lineWidth = 2.0,
this.lineColor = Colors.lightBlue,
this.lineGradient,
this.pointsMode = PointsMode.none,
this.pointSize = 4.0,
this.pointColor = const Color(0xFF0277BD), //Colors.lightBlue[800]
this.sharpCorners = false,
this.fillMode = FillMode.none,
this.fillColor = const Color(0xFF81D4FA), //Colors.lightBlue[200]
this.fillGradient,
this.fallbackHeight = 100.0,
this.fallbackWidth = 300.0,
this.enableGridLines = false,
this.gridLineColor = Colors.grey,
this.gridLineAmount = 5,
this.gridLineWidth = 0.5,
this.gridLineLabelColor = Colors.grey,
this.labelPrefix = "\$",
}) : assert(data != null),
assert(lineWidth != null),
assert(lineColor != null),
assert(pointsMode != null),
assert(pointSize != null),
assert(pointColor != null),
assert(sharpCorners != null),
assert(fillMode != null),
assert(fillColor != null),
assert(fallbackHeight != null),
assert(fallbackWidth != null),
super(key: key);