of static method

Get first ResponsiveLayout ancestor state

Implementation

static ResponsiveLayoutState of(BuildContext context) {
  ResponsiveLayoutState? state =
      context.findAncestorStateOfType<ResponsiveLayoutState>();

  if (state == null) {
    throw FlutterError(
        "SideBar operation requested with a context that does not include a SideBar as descendand.");
  }

  return state;
}