maybeOf<T> static method

NodeFlowController<T, dynamic>? maybeOf<T>(
  1. BuildContext context
)

Returns the NodeFlowController from the nearest NodeFlowScope ancestor, or null if not found.

Use this when the widget might exist outside a NodeFlowScope.

Implementation

static NodeFlowController<T, dynamic>? maybeOf<T>(BuildContext context) {
  final scope = context
      .dependOnInheritedWidgetOfExactType<NodeFlowScope<T>>();
  return scope?.controller;
}