isSubclassOf abstract method

bool isSubclassOf(
  1. Class other, [
  2. Set<String>? visited
])

Determines whether this class is a subclass of other.

This checks the inheritance hierarchy to see if this class directly or transitively extends the given other class.


Parameters

  • other: The class to test against

Returns

  • true if this class extends or derives from other
  • false otherwise

Example

Class<Admin>().isSubclassOf(Class<User>()); // true

Implementation

bool isSubclassOf(Class other, [Set<String>? visited]);