isOfType<U> method

bool isOfType<U>(
  1. RuntimeType<U> type
)

An alias for type.acceptsInstance(this).

This makes RuntimeType.acceptsInstance appear like the is operator. Instead of type.acceptsInstance(instance), use instance.isOfType(type).

Implementation

bool isOfType<U>(RuntimeType<U> type) => type.acceptsInstance(this);