maybeOf static method

FxShellScope? maybeOf(
  1. BuildContext context
)

Returns the FxShellScope if it exists, otherwise returns null. Use this to access the FxShellScope from any descendant widget. Example:

FxShellScope.maybeOf(context)?.openDrawer();

Note: This method is safer than of because it does not throw an assertion. It is recommended to use this method instead of of in most cases. If you are sure the FxShellScope exists, use of instead.

Implementation

static FxShellScope? maybeOf(BuildContext context) {
  return context.dependOnInheritedWidgetOfExactType<FxShellScope>();
}