of<C extends Cube> static method

C? of<C extends Cube>(
  1. BuildContext context
)

Use to get Cube registered in de Widget tree.

Implementation

static C? of<C extends Cube>(BuildContext context) {
  return context.dependOnInheritedWidgetOfExactType<CubeProvider<C>>()?.cube;
}