Skip to content

Commit

Permalink
Upgrade flutter_lints to 2.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
imaNNeo committed May 12, 2022
1 parent f922aa7 commit 8829975
Show file tree
Hide file tree
Showing 17 changed files with 746 additions and 767 deletions.
1 change: 1 addition & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ analyzer:
exclude:
- "**.mocks.dart"
errors:
library_private_types_in_public_api: ignore
prefer_initializing_formals: ignore
# allow self-reference to deprecated members (we do this because otherwise we have
# to annotate every member in every test, assert, etc, when we deprecate something)
Expand Down
4 changes: 1 addition & 3 deletions lib/src/chart/base/axis_chart/axis_chart_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -350,9 +350,7 @@ class FlSpot with EquatableMixin {

///Prints x and y coordinates of FlSpot list
@override
String toString() {
return '(' + x.toString() + ', ' + y.toString() + ')';
}
String toString() => '($x, $y)';

/// Used for splitting lines, or maybe other concepts.
static const FlSpot nullSpot = FlSpot(double.nan, double.nan);
Expand Down
26 changes: 13 additions & 13 deletions lib/src/chart/line_chart/line_chart_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ class LineChartBarData with EquatableMixin {
shadow = shadow ?? const Shadow(color: Colors.transparent),
isStepLineChart = isStepLineChart ?? false,
lineChartStepData = lineChartStepData ?? LineChartStepData() {
FlSpot? _mostLeft, _mostTop, _mostRight, _mostBottom;
FlSpot? mostLeft, mostTop, mostRight, mostBottom;

FlSpot? firstValidSpot;
try {
Expand All @@ -379,26 +379,26 @@ class LineChartBarData with EquatableMixin {
if (spot.isNull()) {
continue;
}
if (_mostLeft == null || spot.x < _mostLeft.x) {
_mostLeft = spot;
if (mostLeft == null || spot.x < mostLeft.x) {
mostLeft = spot;
}

if (_mostRight == null || spot.x > _mostRight.x) {
_mostRight = spot;
if (mostRight == null || spot.x > mostRight.x) {
mostRight = spot;
}

if (_mostTop == null || spot.y > _mostTop.y) {
_mostTop = spot;
if (mostTop == null || spot.y > mostTop.y) {
mostTop = spot;
}

if (_mostBottom == null || spot.y < _mostBottom.y) {
_mostBottom = spot;
if (mostBottom == null || spot.y < mostBottom.y) {
mostBottom = spot;
}
}
mostLeftSpot = _mostLeft!;
mostTopSpot = _mostTop!;
mostRightSpot = _mostRight!;
mostBottomSpot = _mostBottom!;
mostLeftSpot = mostLeft!;
mostTopSpot = mostTop!;
mostRightSpot = mostRight!;
mostBottomSpot = mostBottom!;
}
}

Expand Down
12 changes: 6 additions & 6 deletions lib/src/chart/pie_chart/pie_chart.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,21 +86,21 @@ class BadgeWidgetsDelegate extends MultiChildLayoutDelegate {
@override
void performLayout(Size size) {
for (var index = 0; index < badgeWidgetsCount; index++) {
final _key = badgeWidgetsOffsets.keys.elementAt(index);
final key = badgeWidgetsOffsets.keys.elementAt(index);

final _size = layoutChild(
_key,
final finalSize = layoutChild(
key,
BoxConstraints(
maxWidth: size.width,
maxHeight: size.height,
),
);

positionChild(
_key,
key,
Offset(
badgeWidgetsOffsets[_key]!.dx - (_size.width / 2),
badgeWidgetsOffsets[_key]!.dy - (_size.height / 2),
badgeWidgetsOffsets[key]!.dx - (finalSize.width / 2),
badgeWidgetsOffsets[key]!.dy - (finalSize.height / 2),
),
);
}
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dependencies:
dev_dependencies:
mockito: ^5.1.0
build_runner: ^2.1.7
flutter_lints: ^1.0.4
flutter_lints: ^2.0.1
vector_math: ^2.1.1 #Added to use in some generated codes of mockito
flutter_test:
sdk: flutter
Expand Down
Loading

0 comments on commit 8829975

Please sign in to comment.