Skip to content

Commit

Permalink
Upgrade all the dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
imaNNeo committed Dec 19, 2024
1 parent 301c090 commit 9f879c2
Show file tree
Hide file tree
Showing 14 changed files with 24 additions and 41 deletions.
1 change: 1 addition & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ include: package:very_good_analysis/analysis_options.yaml
analyzer:
exclude:
- "**.mocks.dart"
- "test/**"
linter:
rules:
always_put_required_named_parameters_first: false
Expand Down
3 changes: 0 additions & 3 deletions lib/fl_chart.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/// A highly customizable Flutter chart library that supports Line Chart, Bar Chart, Pie Chart, Scatter Chart, and Radar Chart.
library fl_chart;

export 'src/chart/bar_chart/bar_chart.dart';
export 'src/chart/bar_chart/bar_chart_data.dart';
export 'src/chart/base/axis_chart/axis_chart_data.dart';
Expand Down
8 changes: 3 additions & 5 deletions lib/src/chart/bar_chart/bar_chart_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,7 @@ class BarChartRodData with EquatableMixin {
/// Lerps a [BarChartRodData] based on [t] value, check [Tween.lerp].
static BarChartRodData lerp(BarChartRodData a, BarChartRodData b, double t) =>
BarChartRodData(
// ignore: invalid_use_of_protected_member
gradient: a.gradient?.lerpTo(b.gradient, t),
gradient: Gradient.lerp(a.gradient, b.gradient, t),
color: Color.lerp(a.color, b.color, t),
width: lerpDouble(a.width, b.width, t),
borderRadius: BorderRadius.lerp(a.borderRadius, b.borderRadius, t),
Expand Down Expand Up @@ -555,8 +554,7 @@ class BackgroundBarChartRodData with EquatableMixin {
fromY: lerpDouble(a.fromY, b.fromY, t),
toY: lerpDouble(a.toY, b.toY, t),
color: Color.lerp(a.color, b.color, t),
// ignore: invalid_use_of_protected_member
gradient: a.gradient?.lerpTo(b.gradient, t),
gradient: Gradient.lerp(a.gradient, b.gradient, t),
show: b.show,
);

Expand Down Expand Up @@ -831,7 +829,7 @@ class BarTooltipItem with EquatableMixin {
/// Direction of showing text.
final TextDirection textDirection;

/// List<TextSpan> add further style and format to the text of the tooltip
/// Add further style and format to the text of the tooltip
final List<TextSpan>? children;

/// Used for equality check, see [EquatableMixin].
Expand Down
2 changes: 1 addition & 1 deletion lib/src/chart/bar_chart/bar_chart_helper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class BarChartHelper {
final BarChartGroupData barGroup;
try {
barGroup = barGroups.firstWhere((element) => element.barRods.isNotEmpty);
} catch (e) {
} on Exception catch (_) {
// There is no barChartGroupData with at least one barRod
return (0, 0);
}
Expand Down
4 changes: 2 additions & 2 deletions lib/src/chart/base/axis_chart/axis_chart_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -991,7 +991,7 @@ class HorizontalLine extends FlLine with EquatableMixin {
/// Draws a text label over the line.
final HorizontalLineLabel label;

/// if not drawing dash line, then this is the Strokecap for the line.
/// if not drawing dash line, then this is the StrokeCap for the line.
/// i.e. if the two ends of the line is round or butt or square.
final StrokeCap strokeCap;

Expand Down Expand Up @@ -1062,7 +1062,7 @@ class VerticalLine extends FlLine with EquatableMixin {
/// Draws a text label over the line.
final VerticalLineLabel label;

/// if not drawing dash line, then this is the Strokecap for the line.
/// if not drawing dash line, then this is the StrokeCap for the line.
/// i.e. if the two ends of the line is round or butt or square.
final StrokeCap strokeCap;

Expand Down
8 changes: 2 additions & 6 deletions lib/src/chart/base/axis_chart/axis_chart_painter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -318,9 +318,7 @@ abstract class AxisChartPainter<D extends AxisChartData>
final tp = TextPainter(
text: span,
textDirection: TextDirection.ltr,
);
// ignore: cascade_invocations
tp.layout();
)..layout();

switch (label.direction) {
case LabelDirection.horizontal:
Expand Down Expand Up @@ -426,9 +424,7 @@ abstract class AxisChartPainter<D extends AxisChartData>
final tp = TextPainter(
text: span,
textDirection: TextDirection.ltr,
);
// ignore: cascade_invocations
tp.layout();
)..layout();

switch (label.direction) {
case LabelDirection.horizontal:
Expand Down
2 changes: 1 addition & 1 deletion lib/src/chart/base/custom_interactive_viewer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ class _CustomInteractiveViewerState extends State<CustomInteractiveViewer>
"CustomInteractiveViewer's child must have nonzero dimensions.",
);
// Boundaries that are partially infinite are not allowed because Matrix4's
// rotation and translation methods don't handle infinites well.
// rotation and translation methods don't handle infinite well.
assert(
boundaryRect.isFinite ||
(boundaryRect.left.isInfinite &&
Expand Down
5 changes: 2 additions & 3 deletions lib/src/chart/line_chart/line_chart_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ class LineChartBarData with EquatableMixin {
try {
firstValidSpot =
spots.firstWhere((element) => element != FlSpot.nullSpot);
} catch (e) {
} on Exception catch (_) {
// There is no valid spot
}
if (firstValidSpot != null) {
Expand Down Expand Up @@ -557,7 +557,6 @@ class BarAreaData with EquatableMixin {
show: b.show,
spotsLine: BarAreaSpotsLine.lerp(a.spotsLine, b.spotsLine, t),
color: Color.lerp(a.color, b.color, t),
// ignore: invalid_use_of_protected_member
gradient: Gradient.lerp(a.gradient, b.gradient, t),
cutOffY: lerpDouble(a.cutOffY, b.cutOffY, t)!,
applyCutOffY: b.applyCutOffY,
Expand Down Expand Up @@ -1209,7 +1208,7 @@ class LineTooltipItem with EquatableMixin {
/// Direction of showing text.
final TextDirection textDirection;

/// List<TextSpan> add further style and format to the text of the tooltip
/// Add further style and format to the text of the tooltip
final List<TextSpan>? children;

/// Used for equality check, see [EquatableMixin].
Expand Down
4 changes: 2 additions & 2 deletions lib/src/chart/line_chart/line_chart_helper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class LineChartHelper {
try {
lineBarData =
lineBarsData.firstWhere((element) => element.spots.isNotEmpty);
} catch (e) {
} on Exception catch (_) {
// There is no lineBarData with at least one spot
return (0, 0, 0, 0);
}
Expand All @@ -24,7 +24,7 @@ class LineChartHelper {
try {
firstValidSpot =
lineBarData.spots.firstWhere((element) => element != FlSpot.nullSpot);
} catch (e) {
} on Exception catch (_) {
// There is no valid spot
return (0, 0, 0, 0);
}
Expand Down
8 changes: 1 addition & 7 deletions lib/src/chart/pie_chart/pie_chart.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class _PieChartState extends AnimatedWidgetBaseState<PieChart> {
@override
void initState() {
/// Make sure that [_widgetsPositionHandler] is updated.
_ambiguate(WidgetsBinding.instance)!.addPostFrameCallback((timeStamp) {
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
if (mounted) {
setState(() {});
}
Expand All @@ -50,12 +50,6 @@ class _PieChartState extends AnimatedWidgetBaseState<PieChart> {
super.initState();
}

/// This allows a value of type T or T? to be treated as a value of type T?.
///
/// We use this so that APIs that have become non-nullable can still be used
/// with `!` and `?` to support older versions of the API as well.
T? _ambiguate<T>(T? value) => value;

@override
Widget build(BuildContext context) {
final showingData = _getData();
Expand Down
4 changes: 2 additions & 2 deletions lib/src/chart/pie_chart/pie_chart_painter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ class PieChartPainter extends BaseChartPainter<PieChartData> {
sectionPath,
startLineSeparatorPath,
);
} catch (e) {
} on Exception catch (_) {
/// It's a flutter engine issue with [Path.combine] in web-html renderer
/// https://github.com/imaNNeo/fl_chart/issues/955
}
Expand All @@ -251,7 +251,7 @@ class PieChartPainter extends BaseChartPainter<PieChartData> {
sectionPath,
endLineSeparatorPath,
);
} catch (e) {
} on Exception catch (_) {
/// It's a flutter engine issue with [Path.combine] in web-html renderer
/// https://github.com/imaNNeo/fl_chart/issues/955
}
Expand Down
2 changes: 1 addition & 1 deletion lib/src/chart/scatter_chart/scatter_chart_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ class ScatterTooltipItem with EquatableMixin {
/// Direction of showing text.
final TextDirection textDirection;

/// List<TextSpan> add further style and format to the text of the tooltip
/// Add further style and format to the text of the tooltip
final List<TextSpan>? children;

/// Used for equality check, see [EquatableMixin].
Expand Down
4 changes: 1 addition & 3 deletions lib/src/utils/path_drawing/dash_path.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'dart:ui';
/// Came from [flutter_path_drawing](https://github.com/dnfield/flutter_path_drawing) library.
/// Creates a new path that is drawn from the segments of `source`.
///
/// Dash intervals are controled by the `dashArray` - see [CircularIntervalList]
/// Dash intervals are controlled by the `dashArray` - see [CircularIntervalList]
/// for examples.
///
/// `dashOffset` specifies an initial starting point for the dashing.
Expand All @@ -14,8 +14,6 @@ Path dashPath(
required CircularIntervalList<double> dashArray,
DashOffset? dashOffset,
}) {
assert(dashArray != null); // ignore: unnecessary_null_comparison

dashOffset = dashOffset ?? const DashOffset.absolute(0);
// TODO(imaNNeo): Is there some way to determine how much of a path would be visible today?

Expand Down
10 changes: 5 additions & 5 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,24 @@ documentation: https://github.com/imaNNeo/fl_chart

environment:
sdk: ^3.2.0
flutter: ">=3.27.0"
flutter: ">=3.16.0"

funding:
- https://github.com/sponsors/imaNNeo
- https://www.buymeacoffee.com/fl_chart

dependencies:
equatable: ^2.0.5
equatable: ^2.0.7
flutter:
sdk: flutter
vector_math: ^2.1.4

dev_dependencies:
build_runner: ^2.4.6
build_runner: ^2.4.14
flutter_test:
sdk: flutter
mockito: ^5.4.2
very_good_analysis: ^6.0.0
mockito: ^5.4.5
very_good_analysis: ^7.0.0

screenshots:
- description: "FL Chart Logo"
Expand Down

0 comments on commit 9f879c2

Please sign in to comment.