Sparkline constructor

Sparkline({
  1. Key? key,
  2. required List<double> data,
  3. double lineWidth = 2.0,
  4. Color? lineColor = Colors.lightBlue,
  5. Gradient? lineGradient,
  6. PointsMode pointsMode = PointsMode.none,
  7. double pointSize = 4.0,
  8. Color pointColor = const Color(0xFF0277BD),
  9. bool sharpCorners = false,
  10. FillMode fillMode = FillMode.none,
  11. Color? fillColor = const Color(0xFF81D4FA),
  12. Gradient? fillGradient,
  13. double fallbackHeight = 100.0,
  14. double fallbackWidth = 300.0,
  15. bool enableGridLines = false,
  16. Color gridLineColor = Colors.grey,
  17. int gridLineAmount = 5,
  18. double gridLineWidth = 0.5,
  19. Color gridLineLabelColor = Colors.grey,
  20. 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);