getPlugin<P extends StoragePluginInterface> method

P getPlugin<P extends StoragePluginInterface>(
  1. StoragePluginKey<P> pluginKey
)

Implementation

P getPlugin<P extends StoragePluginInterface>(
  StoragePluginKey<P> pluginKey,
) =>
    plugins.singleWhere(
      (p) => p is P,
      orElse: () => throw PluginError(
        'No plugin registered for $pluginKey',
      ),
    ) as P;