checkIfTypesAvailable method
void
checkIfTypesAvailable()
Implementation
void checkIfTypesAvailable() {
final names = <String>{};
final types = <String>{};
final extendsModels = <String>{};
for (final model in models) {
names.add(model.name);
if (model.extendsModel != null) {
extendsModels.add(model.extendsModel!);
}
if (model is ObjectModel) {
for (final field in model.fields) {
final type = field.type;
types.add(type.name);
if (type is MapType) {
types.add(type.valueName);
}
}
}
}
print('Registered models:');
print(names);
print('=======');
print('Models used as a field in another model:');
print(types);
if (extendsModels.isNotEmpty) {
print('=======');
print('Models being extended:');
print(extendsModels);
}
for (final type in types) {
DartType(type).checkTypesKnown(names);
}
for (final extendsType in extendsModels) {
checkTypesKnown(names, extendsType);
}
}