getPlugin<E extends NodeFlowPlugin> method

E? getPlugin<E extends NodeFlowPlugin>()

Gets a plugin by its type.

Returns null if no plugin of the given type is registered. Useful for plugins that expose additional capabilities.

Example:

final history = controller.getPlugin<HistoryPlugin>();
if (history?.canUndo ?? false) {
  history!.undo();
}

Implementation

E? getPlugin<E extends NodeFlowPlugin>() {
  for (final ext in _plugins) {
    if (ext is E) return ext;
  }
  return null;
}