of method

PageStorageBucket of (BuildContext context)

The bucket from the closest instance of this class that encloses the given context.

Returns null if none exists.

Typical usage is as follows:

PageStorageBucket bucket = PageStorage.of(context);

Implementation

static PageStorageBucket of(BuildContext context) {
  final PageStorage widget = context.ancestorWidgetOfExactType(PageStorage);
  return widget?.bucket;
}