ensurePlugin<T> method

T ensurePlugin<T>(
  1. PluginType type, {
  2. bool mustExist = true,
})

Implementation

T ensurePlugin<T>(PluginType type, {bool mustExist = true}) {
  final plugin = getPlugin(type) as T;

  if (mustExist) {
    assert(plugin != null, '$T is not available in your plugins');
  }

  return plugin;
}