findInterfaceArguments<I> abstract method

List<Class> findInterfaceArguments<I>(
  1. Class parentClass, [
  2. bool declared = true
])

Finds all interface arguments of the specified class with caching.

{@template class_loader_find_interface_arguments_as} Parameters:

  • parentClass: The class to find interface arguments for
  • declared: Whether to include inherited interface arguments (default: true)

Returns:

  • List of interface arguments
  • Empty list if no interface arguments are found
  • Cached results for subsequent calls

Example

final listClass = await loader.loadClass<List>('dart:core/list.dart.List');
final interfaceArgs = await loader.findInterfaceArguments(listClass);
// Returns: [Iterable, Collection, etc.]

// Direct interface arguments only
final directInterfaceArgs = await loader.findInterfaceArguments(listClass, false);

Caching Behavior

  • Separate caches for transitive and direct interface queries
  • Cache keys include the transitive flag for proper segregation
  • Automatic cache invalidation on class hierarchy changes {@endtemplate}

Implementation

List<Class> findInterfaceArguments<I>(Class parentClass, [bool declared = true]);