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);

Source

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