of static method

MasterDetailScaffoldState? of(
  1. BuildContext context, {
  2. bool nullOk = false,
})

The state of the nearest instance of the MasterDetailScaffold widget.

Implementation

static MasterDetailScaffoldState? of(BuildContext context,
    {bool nullOk = false}) {
  final MasterDetailScaffoldState? result =
      context.findAncestorStateOfType<MasterDetailScaffoldState>();
  if (nullOk || result != null) return result;
  throw FlutterError(
      'MasterDetailScaffold.of() called with a context that does not contain a MasterDetailScaffold.');
}