ensureIsSubTypeOf<Parent extends Object> function
Implementation
void ensureIsSubTypeOf<Parent extends Object>(Type objectType) {
try {
final type = reflectType(objectType);
if (type.superclass!.reflectedType != Parent) throw Exception();
} catch (e) {
throw ArgumentError.value(objectType, 'Invalid Type provided',
'Ensure your class extends `$Parent` class');
}
}