of static method

The controller of the closest enclosing DrawerLayout.

Implementation

static DrawerLayoutController of(BuildContext context) {
  final scope = context.dependOnInheritedWidgetOfExactType<_DrawerLayoutScope>();
  assert(scope != null, 'DrawerLayout.of() called with no DrawerLayout in context.');
  return scope!.controller;
}