Skip to content

Commit

Permalink
Flutter format
Browse files Browse the repository at this point in the history
  • Loading branch information
Wendel de Witte committed Jan 6, 2021
1 parent 4e813ae commit 00b38fa
Showing 1 changed file with 15 additions and 19 deletions.
34 changes: 15 additions & 19 deletions lib/src/chart/pie_chart/pie_chart.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,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 @@ -77,8 +77,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 @@ -89,8 +89,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 @@ -102,8 +102,7 @@ class _PieChartState extends AnimatedWidgetBaseState<PieChart> {
}

final PieTouchResponse response = _touchHandler?.handleTouch(
FlPanEnd(Offset.zero, const Velocity(pixelsPerSecond: Offset.zero)),
chartSize);
FlPanEnd(Offset.zero, const Velocity(pixelsPerSecond: Offset.zero)), chartSize);
if (_canHandleTouch(response, touchData)) {
touchData.touchCallback(response);
}
Expand All @@ -114,8 +113,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 @@ -126,8 +125,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 @@ -138,8 +137,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 Expand Up @@ -216,14 +215,11 @@ class _PieChartState extends AnimatedWidgetBaseState<PieChart> {
}

bool _canHandleTouch(PieTouchResponse response, PieTouchData touchData) {
return response != null &&
touchData != null &&
touchData.touchCallback != null;
return response != null && touchData != null && touchData.touchCallback != null;
}

Size _getChartSize() {
final RenderBox containerRenderBox =
_chartKey.currentContext?.findRenderObject();
final RenderBox containerRenderBox = _chartKey.currentContext?.findRenderObject();
if (containerRenderBox != null && containerRenderBox.hasSize) {
return containerRenderBox.size;
}
Expand Down

0 comments on commit 00b38fa

Please sign in to comment.