getPluginsForType method

List<TypeInfo> getPluginsForType(
  1. TypeInfo type
)

Implementation

List<TypeInfo> getPluginsForType(TypeInfo type){
  List<TypeInfo> plugins = [];

  allTypes.forEach((name, ce){
    if (ce.element != null) {
      ce.element!.allSupertypes.forEach((st){
        if (st.getDisplayString(withNullability: false).startsWith('TypePlugin<') && st.typeArguments.length == 1 && typeSystem.isAssignableTo(type.type, st.typeArguments[0])) {
          plugins.add(ce);
        }
      });
    }
  });
  return plugins;
}