of method Null safety

SfGaugeThemeData? of(
  1. BuildContext context
)

The data from the closest SfGaugeTheme instance that encloses the given context.

Defaults to SfGaugeTheme.gaugeThemeData if there is no SfGaugeTheme in the given build context.

Implementation

static SfGaugeThemeData? of(BuildContext context) {
  final SfGaugeTheme? sfGaugeTheme =
      context.dependOnInheritedWidgetOfExactType<SfGaugeTheme>();
  return sfGaugeTheme?.data ?? SfTheme.of(context).gaugeThemeData;
}