maybeOf static method

WizardScopeState? maybeOf(
  1. BuildContext context, {
  2. bool root = false,
})

The wizard scope from the closest instance of this class that encloses the given context.

If no instance of this class encloses the given context, will return null. To throw an exception instead, use of instead of this function.

See also:

Implementation

static WizardScopeState? maybeOf(BuildContext context, {bool root = false}) {
  return root
      ? context.findRootAncestorStateOfType<WizardScopeState>()
      : context.findAncestorStateOfType<WizardScopeState>();
}