of static method

Depends on the the nearest SkeletonizerScope if any otherwise it throws

Implementation

static SkeletonizerScope of(BuildContext context) {
  final scope =
      context.dependOnInheritedWidgetOfExactType<SkeletonizerScope>();
  assert(() {
    if (scope == null) {
      throw FlutterError(
        'Skeletonizer operation requested with a context that does not include a Skeletonizer.\n'
        'The context used to push or pop routes from the Navigator must be that of a '
        'widget that is a descendant of a Skeletonizer widget.',
      );
    }
    return true;
  }());
  return scope!;
}