Skip to content

Commit

Permalink
Migrate base_chart_painter, axis_chart_painter
Browse files Browse the repository at this point in the history
  • Loading branch information
imaNNeo committed Mar 3, 2021
1 parent 54cb96d commit cdacdb7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
12 changes: 4 additions & 8 deletions lib/src/chart/base/axis_chart/axis_chart_painter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ import 'axis_chart_data.dart';
/// [data] is the currently showing data (it may produced by an animation using lerp function),
/// [targetData] is the target data, that animation is going to show (if animating)
abstract class AxisChartPainter<D extends AxisChartData> extends BaseChartPainter<D> {
Paint _gridPaint, _backgroundPaint;
late Paint _gridPaint, _backgroundPaint;

/// [_rangeAnnotationPaint] draws range annotations;
Paint _rangeAnnotationPaint;
late Paint _rangeAnnotationPaint;

AxisChartPainter(D data, D targetData, {double textScale})
AxisChartPainter(D data, D targetData, {required double textScale})
: super(data, targetData, textScale: textScale) {
_gridPaint = Paint()..style = PaintingStyle.stroke;

Expand Down Expand Up @@ -200,7 +200,7 @@ abstract class AxisChartPainter<D extends AxisChartData> extends BaseChartPainte
}

void _drawGrid(CanvasWrapper canvasWrapper) {
if (!data.gridData.show || data.gridData == null) {
if (!data.gridData.show) {
return;
}
final viewSize = canvasWrapper.size;
Expand Down Expand Up @@ -291,10 +291,6 @@ abstract class AxisChartPainter<D extends AxisChartData> extends BaseChartPainte
}

void _drawRangeAnnotation(CanvasWrapper canvasWrapper) {
if (data.rangeAnnotations == null) {
return;
}

final viewSize = canvasWrapper.size;
final chartUsableSize = getChartUsableDrawSize(viewSize);

Expand Down
2 changes: 1 addition & 1 deletion lib/src/chart/base/base_chart/base_chart_painter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import 'touch_input.dart';
abstract class BaseChartPainter<D extends BaseChartData> extends CustomPainter {
final D data;
final D targetData;
Paint _borderPaint;
late Paint _borderPaint;
double textScale;

/// Draws some basic things line border
Expand Down

0 comments on commit cdacdb7

Please sign in to comment.