of static method

RawSpacings of(
  1. BuildContext context
)

The closest RawSpacings instance that encloses the given context.

If no ancestor is found, defaults to the defaultSpacings instance

Implementation

static RawSpacings of(BuildContext context) {
  final resolverAncestor = context.dependOnInheritedWidgetOfExactType<SpacingsInheritedWidget>();
  return resolverAncestor?.spacings ?? defaultSpacings;
}