Skip to content

Commit

Permalink
fix FlSpot.isNull
Browse files Browse the repository at this point in the history
Fixes a broken performance optimization. Chart was empty when it contained null-spots.
  • Loading branch information
samuelsadok authored Apr 11, 2024
1 parent b1fa0d7 commit 908606e
Showing 1 changed file with 1 addition and 3 deletions.
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 @@ -434,13 +434,11 @@ class FlSpot {
/// Used for splitting lines, or maybe other concepts.
static const FlSpot nullSpot = FlSpot(double.nan, double.nan);

static const double nullDoubleSpot = double.nan;

/// Sets zero for x and y
static const FlSpot zero = FlSpot(0, 0);

/// Determines if [x] or [y] is null.
bool isNull() => x == nullDoubleSpot && y == nullDoubleSpot;
bool isNull() => x.isNaN && y.isNaN;

/// Determines if [x] and [y] is not null.
bool isNotNull() => !isNull();
Expand Down

0 comments on commit 908606e

Please sign in to comment.