maybeOf static method

SkeletonizerConfigData? maybeOf(
  1. BuildContext context
)

The SkeletonizerConfigData instance of the closest ancestor Theme.extension if exists, otherwise null.

Implementation

static SkeletonizerConfigData? maybeOf(BuildContext context) {
  final SkeletonizerConfig? inherited =
      context.dependOnInheritedWidgetOfExactType<SkeletonizerConfig>();
  return inherited?.data ??
      Theme.of(context).extension<SkeletonizerConfigData>();
}