Skip to content

Commit

Permalink
Format changed files
Browse files Browse the repository at this point in the history
Signed-off-by: Shripal Jain <[email protected]>
  • Loading branch information
shripal17 committed Jan 23, 2021
1 parent e64de1f commit c48d8dd
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 31 deletions.
30 changes: 20 additions & 10 deletions lib/src/chart/bar_chart/bar_chart.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ class _BarChartState extends AnimatedWidgetBaseState<BarChart> {
return;
}

final BarTouchResponse response = _touchHandler?.handleTouch(FlPanStart(e.localPosition), chartSize);
final BarTouchResponse response =
_touchHandler?.handleTouch(FlPanStart(e.localPosition), chartSize);
if (_canHandleTouch(response, touchData)) {
touchData.touchCallback(response);
}
Expand All @@ -56,7 +57,8 @@ class _BarChartState extends AnimatedWidgetBaseState<BarChart> {
return;
}

final BarTouchResponse response = _touchHandler?.handleTouch(FlPanEnd(Offset.zero, const Velocity(pixelsPerSecond: Offset.zero)), chartSize);
final BarTouchResponse response = _touchHandler?.handleTouch(
FlPanEnd(Offset.zero, const Velocity(pixelsPerSecond: Offset.zero)), chartSize);
if (_canHandleTouch(response, touchData)) {
touchData.touchCallback(response);
}
Expand All @@ -67,7 +69,8 @@ class _BarChartState extends AnimatedWidgetBaseState<BarChart> {
return;
}

final BarTouchResponse response = _touchHandler?.handleTouch(FlPanMoveUpdate(e.localPosition), chartSize);
final BarTouchResponse response =
_touchHandler?.handleTouch(FlPanMoveUpdate(e.localPosition), chartSize);
if (_canHandleTouch(response, touchData)) {
touchData.touchCallback(response);
}
Expand All @@ -79,7 +82,8 @@ class _BarChartState extends AnimatedWidgetBaseState<BarChart> {
return;
}

final BarTouchResponse response = _touchHandler?.handleTouch(FlLongPressStart(d.localPosition), chartSize);
final BarTouchResponse response =
_touchHandler?.handleTouch(FlLongPressStart(d.localPosition), chartSize);
if (_canHandleTouch(response, touchData)) {
touchData.touchCallback(response);
}
Expand All @@ -90,7 +94,8 @@ class _BarChartState extends AnimatedWidgetBaseState<BarChart> {
return;
}

final BarTouchResponse response = _touchHandler?.handleTouch(FlLongPressEnd(d.localPosition), chartSize);
final BarTouchResponse response =
_touchHandler?.handleTouch(FlLongPressEnd(d.localPosition), chartSize);
if (_canHandleTouch(response, touchData)) {
touchData.touchCallback(response);
}
Expand All @@ -101,7 +106,8 @@ class _BarChartState extends AnimatedWidgetBaseState<BarChart> {
return;
}

final BarTouchResponse response = _touchHandler?.handleTouch(FlLongPressMoveUpdate(d.localPosition), chartSize);
final BarTouchResponse response =
_touchHandler?.handleTouch(FlLongPressMoveUpdate(d.localPosition), chartSize);
if (_canHandleTouch(response, touchData)) {
touchData.touchCallback(response);
}
Expand All @@ -112,7 +118,8 @@ class _BarChartState extends AnimatedWidgetBaseState<BarChart> {
return;
}

final BarTouchResponse response = _touchHandler?.handleTouch(FlPanEnd(Offset.zero, const Velocity(pixelsPerSecond: Offset.zero)), chartSize);
final BarTouchResponse response = _touchHandler?.handleTouch(
FlPanEnd(Offset.zero, const Velocity(pixelsPerSecond: Offset.zero)), chartSize);
if (_canHandleTouch(response, touchData)) {
touchData.touchCallback(response);
}
Expand All @@ -123,7 +130,8 @@ class _BarChartState extends AnimatedWidgetBaseState<BarChart> {
return;
}

final BarTouchResponse response = _touchHandler?.handleTouch(FlPanEnd(Offset.zero, details.velocity), chartSize);
final BarTouchResponse response =
_touchHandler?.handleTouch(FlPanEnd(Offset.zero, details.velocity), chartSize);
if (_canHandleTouch(response, touchData)) {
touchData.touchCallback(response);
}
Expand All @@ -134,7 +142,8 @@ class _BarChartState extends AnimatedWidgetBaseState<BarChart> {
return;
}

final BarTouchResponse response = _touchHandler?.handleTouch(FlPanStart(details.localPosition), chartSize);
final BarTouchResponse response =
_touchHandler?.handleTouch(FlPanStart(details.localPosition), chartSize);
if (_canHandleTouch(response, touchData)) {
touchData.touchCallback(response);
}
Expand All @@ -145,7 +154,8 @@ class _BarChartState extends AnimatedWidgetBaseState<BarChart> {
return;
}

final BarTouchResponse response = _touchHandler?.handleTouch(FlPanMoveUpdate(details.localPosition), chartSize);
final BarTouchResponse response =
_touchHandler?.handleTouch(FlPanMoveUpdate(details.localPosition), chartSize);
if (_canHandleTouch(response, touchData)) {
touchData.touchCallback(response);
}
Expand Down
33 changes: 22 additions & 11 deletions lib/src/chart/line_chart/line_chart.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ class _LineChartState extends AnimatedWidgetBaseState<LineChart> {
return;
}

final LineTouchResponse response = _touchHandler?.handleTouch(FlPanStart(e.localPosition), chartSize);
final LineTouchResponse response =
_touchHandler?.handleTouch(FlPanStart(e.localPosition), chartSize);
if (_canHandleTouch(response, touchData)) {
touchData.touchCallback(response);
}
Expand All @@ -61,7 +62,8 @@ class _LineChartState extends AnimatedWidgetBaseState<LineChart> {
return;
}

final LineTouchResponse response = _touchHandler?.handleTouch(FlPanEnd(Offset.zero, Velocity.zero), chartSize);
final LineTouchResponse response =
_touchHandler?.handleTouch(FlPanEnd(Offset.zero, Velocity.zero), chartSize);
if (_canHandleTouch(response, touchData)) {
touchData.touchCallback(response);
}
Expand All @@ -72,7 +74,8 @@ class _LineChartState extends AnimatedWidgetBaseState<LineChart> {
return;
}

final LineTouchResponse response = _touchHandler?.handleTouch(FlPanMoveUpdate(e.localPosition), chartSize);
final LineTouchResponse response =
_touchHandler?.handleTouch(FlPanMoveUpdate(e.localPosition), chartSize);
if (_canHandleTouch(response, touchData)) {
touchData.touchCallback(response);
}
Expand All @@ -84,7 +87,8 @@ class _LineChartState extends AnimatedWidgetBaseState<LineChart> {
return;
}

final LineTouchResponse response = _touchHandler?.handleTouch(FlLongPressStart(d.localPosition), chartSize);
final LineTouchResponse response =
_touchHandler?.handleTouch(FlLongPressStart(d.localPosition), chartSize);
if (_canHandleTouch(response, touchData)) {
touchData.touchCallback(response);
}
Expand All @@ -95,7 +99,8 @@ class _LineChartState extends AnimatedWidgetBaseState<LineChart> {
return;
}

final LineTouchResponse response = _touchHandler?.handleTouch(FlLongPressEnd(d.localPosition), chartSize);
final LineTouchResponse response =
_touchHandler?.handleTouch(FlLongPressEnd(d.localPosition), chartSize);
if (_canHandleTouch(response, touchData)) {
touchData.touchCallback(response);
}
Expand All @@ -106,7 +111,8 @@ class _LineChartState extends AnimatedWidgetBaseState<LineChart> {
return;
}

final LineTouchResponse response = _touchHandler?.handleTouch(FlLongPressMoveUpdate(d.localPosition), chartSize);
final LineTouchResponse response =
_touchHandler?.handleTouch(FlLongPressMoveUpdate(d.localPosition), chartSize);
if (_canHandleTouch(response, touchData)) {
touchData.touchCallback(response);
}
Expand All @@ -117,7 +123,8 @@ class _LineChartState extends AnimatedWidgetBaseState<LineChart> {
return;
}

final LineTouchResponse response = _touchHandler?.handleTouch(FlPanEnd(Offset.zero, const Velocity(pixelsPerSecond: Offset.zero)), chartSize);
final LineTouchResponse response = _touchHandler?.handleTouch(
FlPanEnd(Offset.zero, const Velocity(pixelsPerSecond: Offset.zero)), chartSize);
if (_canHandleTouch(response, touchData)) {
touchData.touchCallback(response);
}
Expand All @@ -128,7 +135,8 @@ class _LineChartState extends AnimatedWidgetBaseState<LineChart> {
return;
}

final LineTouchResponse response = _touchHandler?.handleTouch(FlPanEnd(Offset.zero, details.velocity), chartSize);
final LineTouchResponse response =
_touchHandler?.handleTouch(FlPanEnd(Offset.zero, details.velocity), chartSize);
if (_canHandleTouch(response, touchData)) {
touchData.touchCallback(response);
}
Expand All @@ -139,7 +147,8 @@ class _LineChartState extends AnimatedWidgetBaseState<LineChart> {
return;
}

final LineTouchResponse response = _touchHandler?.handleTouch(FlPanStart(details.localPosition), chartSize);
final LineTouchResponse response =
_touchHandler?.handleTouch(FlPanStart(details.localPosition), chartSize);
if (_canHandleTouch(response, touchData)) {
touchData.touchCallback(response);
}
Expand All @@ -150,15 +159,17 @@ class _LineChartState extends AnimatedWidgetBaseState<LineChart> {
return;
}

final LineTouchResponse response = _touchHandler?.handleTouch(FlPanMoveUpdate(details.localPosition), chartSize);
final LineTouchResponse response =
_touchHandler?.handleTouch(FlPanMoveUpdate(details.localPosition), chartSize);
if (_canHandleTouch(response, touchData)) {
touchData.touchCallback(response);
}
},
child: CustomPaint(
key: _chartKey,
size: getDefaultSize(MediaQuery.of(context).size),
painter: LineChartPainter(_withTouchedIndicators(_lineChartDataTween.evaluate(animation)), _withTouchedIndicators(showingData), (touchHandler) {
painter: LineChartPainter(_withTouchedIndicators(_lineChartDataTween.evaluate(animation)),
_withTouchedIndicators(showingData), (touchHandler) {
setState(() {
_touchHandler = touchHandler;
});
Expand Down
30 changes: 20 additions & 10 deletions lib/src/chart/pie_chart/pie_chart.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ class _PieChartState extends AnimatedWidgetBaseState<PieChart> {
return;
}

final PieTouchResponse response = _touchHandler?.handleTouch(FlPanStart(e.localPosition), chartSize);
final PieTouchResponse response =
_touchHandler?.handleTouch(FlPanStart(e.localPosition), chartSize);
if (_canHandleTouch(response, touchData)) {
touchData.touchCallback(response);
}
Expand All @@ -78,7 +79,8 @@ class _PieChartState extends AnimatedWidgetBaseState<PieChart> {
return;
}

final PieTouchResponse response = _touchHandler?.handleTouch(FlPanEnd(Offset.zero, const Velocity(pixelsPerSecond: Offset.zero)), chartSize);
final PieTouchResponse response = _touchHandler?.handleTouch(
FlPanEnd(Offset.zero, const Velocity(pixelsPerSecond: Offset.zero)), chartSize);
if (_canHandleTouch(response, touchData)) {
touchData.touchCallback(response);
}
Expand All @@ -89,7 +91,8 @@ class _PieChartState extends AnimatedWidgetBaseState<PieChart> {
return;
}

final PieTouchResponse response = _touchHandler?.handleTouch(FlPanMoveUpdate(e.localPosition), chartSize);
final PieTouchResponse response =
_touchHandler?.handleTouch(FlPanMoveUpdate(e.localPosition), chartSize);
if (_canHandleTouch(response, touchData)) {
touchData.touchCallback(response);
}
Expand All @@ -100,7 +103,8 @@ class _PieChartState extends AnimatedWidgetBaseState<PieChart> {
if (chartSize == null) {
return;
}
final PieTouchResponse response = _touchHandler?.handleTouch(FlLongPressStart(d.localPosition), chartSize);
final PieTouchResponse response =
_touchHandler?.handleTouch(FlLongPressStart(d.localPosition), chartSize);
if (_canHandleTouch(response, touchData)) {
touchData.touchCallback(response);
}
Expand All @@ -111,7 +115,8 @@ class _PieChartState extends AnimatedWidgetBaseState<PieChart> {
return;
}

final PieTouchResponse response = _touchHandler?.handleTouch(FlLongPressEnd(d.localPosition), chartSize);
final PieTouchResponse response =
_touchHandler?.handleTouch(FlLongPressEnd(d.localPosition), chartSize);
if (_canHandleTouch(response, touchData)) {
touchData.touchCallback(response);
}
Expand All @@ -122,7 +127,8 @@ class _PieChartState extends AnimatedWidgetBaseState<PieChart> {
return;
}

final PieTouchResponse response = _touchHandler?.handleTouch(FlLongPressMoveUpdate(d.localPosition), chartSize);
final PieTouchResponse response =
_touchHandler?.handleTouch(FlLongPressMoveUpdate(d.localPosition), chartSize);
if (_canHandleTouch(response, touchData)) {
touchData.touchCallback(response);
}
Expand All @@ -133,7 +139,8 @@ class _PieChartState extends AnimatedWidgetBaseState<PieChart> {
return;
}

final PieTouchResponse response = _touchHandler?.handleTouch(FlPanEnd(Offset.zero, const Velocity(pixelsPerSecond: Offset.zero)), chartSize);
final PieTouchResponse response = _touchHandler?.handleTouch(
FlPanEnd(Offset.zero, const Velocity(pixelsPerSecond: Offset.zero)), chartSize);
if (_canHandleTouch(response, touchData)) {
touchData.touchCallback(response);
}
Expand All @@ -144,7 +151,8 @@ class _PieChartState extends AnimatedWidgetBaseState<PieChart> {
return;
}

final PieTouchResponse response = _touchHandler?.handleTouch(FlPanEnd(Offset.zero, details.velocity), chartSize);
final PieTouchResponse response =
_touchHandler?.handleTouch(FlPanEnd(Offset.zero, details.velocity), chartSize);
if (_canHandleTouch(response, touchData)) {
touchData.touchCallback(response);
}
Expand All @@ -155,7 +163,8 @@ class _PieChartState extends AnimatedWidgetBaseState<PieChart> {
return;
}

final PieTouchResponse response = _touchHandler?.handleTouch(FlPanStart(details.localPosition), chartSize);
final PieTouchResponse response =
_touchHandler?.handleTouch(FlPanStart(details.localPosition), chartSize);
if (_canHandleTouch(response, touchData)) {
touchData.touchCallback(response);
}
Expand All @@ -166,7 +175,8 @@ class _PieChartState extends AnimatedWidgetBaseState<PieChart> {
return;
}

final PieTouchResponse response = _touchHandler?.handleTouch(FlPanMoveUpdate(details.localPosition), chartSize);
final PieTouchResponse response =
_touchHandler?.handleTouch(FlPanMoveUpdate(details.localPosition), chartSize);
if (_canHandleTouch(response, touchData)) {
touchData.touchCallback(response);
}
Expand Down

0 comments on commit c48d8dd

Please sign in to comment.