SimpleBarChart constructor

const SimpleBarChart({
  1. Key? key,
  2. required List<SimpleBarChartData> data,
  3. SimpleBarChartOrientation orientation = SimpleBarChartOrientation.vertical,
  4. SimpleBarChartStyle style = SimpleBarChartStyle.elegant,
  5. double? minValue,
  6. double? maxValue,
  7. double height = 240,
  8. EdgeInsets? padding,
  9. Color? barColor,
  10. Color? gridColor,
  11. Color? axisColor,
  12. Color? trackColor,
  13. Color? activeBarColor,
  14. TextStyle? labelStyle,
  15. TextStyle? valueStyle,
  16. bool showGrid = true,
  17. bool showValues = true,
  18. bool showTrack = false,
  19. bool showTooltip = true,
  20. bool showActiveBar = true,
  21. List<SimpleChartReferenceLine> referenceLines = const [],
  22. List<SimpleChartReferenceBand> referenceBands = const [],
  23. int gridLineCount = 4,
  24. double? barRadius,
  25. double? barWidthFactor,
  26. double? maxBarWidth,
  27. bool? useGradient,
  28. SimpleBarValueFormatter? valueFormatter,
  29. SimpleBarTapCallback? onBarTap,
  30. SimpleBarTooltipBuilder? tooltipBuilder,
  31. WidgetBuilder? emptyBuilder,
  32. String? semanticLabel,
  33. bool excludeFromSemantics = false,
  34. Duration animationDuration = const Duration(milliseconds: 650),
  35. Curve animationCurve = Curves.easeOutCubic,
})

Implementation

const SimpleBarChart({
  super.key,
  required this.data,
  this.orientation = SimpleBarChartOrientation.vertical,
  this.style = SimpleBarChartStyle.elegant,
  this.minValue,
  this.maxValue,
  this.height = 240,
  this.padding,
  this.barColor,
  this.gridColor,
  this.axisColor,
  this.trackColor,
  this.activeBarColor,
  this.labelStyle,
  this.valueStyle,
  this.showGrid = true,
  this.showValues = true,
  this.showTrack = false,
  this.showTooltip = true,
  this.showActiveBar = true,
  this.referenceLines = const [],
  this.referenceBands = const [],
  this.gridLineCount = 4,
  this.barRadius,
  this.barWidthFactor,
  this.maxBarWidth,
  this.useGradient,
  this.valueFormatter,
  this.onBarTap,
  this.tooltipBuilder,
  this.emptyBuilder,
  this.semanticLabel,
  this.excludeFromSemantics = false,
  this.animationDuration = const Duration(milliseconds: 650),
  this.animationCurve = Curves.easeOutCubic,
}) : assert(gridLineCount >= 2),
     assert(barRadius == null || barRadius >= 0),
     assert(
       barWidthFactor == null || (barWidthFactor > 0 && barWidthFactor <= 1),
     ),
     assert(maxBarWidth == null || maxBarWidth > 0),
     assert(height > 0);