isSubsetOf method

bool isSubsetOf(
  1. ClassDefinition other
)

Implementation

bool isSubsetOf(ClassDefinition other) {
  final List<String> keys = this.fields.keys.toList();
  final int len = keys.length;
  for (int i = 0; i < len; i++) {
    TypeDefinition? otherTypeDef = other.fields[keys[i]];
    if (otherTypeDef != null) {
      TypeDefinition? typeDef = this.fields[keys[i]];
      if (typeDef != otherTypeDef) {
        return false;
      }
    } else {
      return false;
    }
  }
  return true;
}