pluginOf<T> method Null safety

T? pluginOf<T>()

Returns the plugin of the specified type in the array of plugins

Implementation

T? pluginOf<T>() {
  MBPlugin? plugin = _plugins.firstWhereOrNull(
    (plugin) => plugin is T,
  );
  if (plugin != null) {
    return plugin as T;
  }
  return null;
}