isOf method

bool isOf(
  1. Type type, [
  2. List<Object>? arguments
])

Returns true if this instances has the same type and arguments.

Implementation

bool isOf(Type type, [List<Object>? arguments]) {
  var t = TypeInfo.from(type);

  if (!equalsType(t)) return false;

  if (arguments != null) {
    if (hasArguments) {
      return argumentsLength == arguments.length &&
          _listEqualityTypeInfo.equals(
              _arguments, TypeInfo.toList(arguments));
    } else {
      return arguments.isEmpty;
    }
  } else {
    return true;
  }
}