didChangeDependencies method Null safety

  1. @override
void didChangeDependencies()
override

Called when a dependency of this State object changes.

For example, if the previous call to build referenced an InheritedWidget that later changed, the framework would call this method to notify this object about the change.

This method is also called immediately after initState. It is safe to call BuildContext.dependOnInheritedWidgetOfExactType from this method.

Here it called for initializing the chart theme of SfCircularChart.

Implementation

@override
void didChangeDependencies() {
  _renderingDetails.chartTheme = SfChartTheme.of(context);
  super.didChangeDependencies();
}