hasNestedType function
Check if data
has any child that has type type
.
Implementation
bool hasNestedType(MapEntry<String, dynamic> data, {required String type}) {
final value = data.value as Map<String, dynamic>;
if (value.containsKey('type')) {
return value['type'] == type;
}
return hasNestedType(value.entries.first, type: type);
}