Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
solve the warning
Browse files Browse the repository at this point in the history
  • Loading branch information
joyhope committed May 17, 2022
1 parent 220ea94 commit 579669e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion charts_flutter/example/lib/behaviors/slider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class _SliderCallbackState extends State<SliderLine> {
});
}

SchedulerBinding.instance!.addPostFrameCallback(rebuild);
SchedulerBinding.instance.addPostFrameCallback(rebuild);
}

@override
Expand Down
8 changes: 4 additions & 4 deletions charts_flutter/lib/src/chart_container.dart
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,11 @@ class ChartContainerRenderObject<D> extends RenderCustomPaint

// Sometimes chart behaviors try to draw the chart outside of a Flutter draw
// cycle. Schedule a frame manually to handle these cases.
if (!SchedulerBinding.instance!.hasScheduledFrame) {
SchedulerBinding.instance!.scheduleFrame();
if (!SchedulerBinding.instance.hasScheduledFrame) {
SchedulerBinding.instance.scheduleFrame();
}

SchedulerBinding.instance!.addPostFrameCallback(startAnimationController);
SchedulerBinding.instance.addPostFrameCallback(startAnimationController);
}

/// Request Flutter to rebuild the widget/container of chart.
Expand All @@ -229,7 +229,7 @@ class ChartContainerRenderObject<D> extends RenderCustomPaint
// This is needed to request rebuild after the legend has been added in the
// post process phase of the chart, which happens during the chart widget's
// build cycle.
SchedulerBinding.instance!.addPostFrameCallback(doRebuild);
SchedulerBinding.instance.addPostFrameCallback(doRebuild);
}

/// When Flutter's markNeedsLayout is called, layout and paint are both
Expand Down

0 comments on commit 579669e

Please sign in to comment.