requireBool function
Returns the boolean at key in map, or throws a typed
CrossmintDeserializationException naming entity and key.
Implementation
bool requireBool(CrossmintJsonMap map, String key, {required String entity}) {
final Object? value = map[key];
if (value is bool) {
return value;
}
throw CrossmintDeserializationException(
'Expected boolean for "$key" while parsing $entity.',
entity: entity,
field: key,
cause: map,
);
}