getCurrentGenerateContentExtraAttributes function
The current zone-scoped extra attributes for generate-content spans.
Implementation
Map<String, Object?>? getCurrentGenerateContentExtraAttributes() {
final Object? value = Zone.current[_generateContentExtraAttributesContextKey];
if (value is Map<String, Object?>) {
return value;
}
if (value is Map) {
return value.map(
(Object? key, Object? nestedValue) =>
MapEntry<String, Object?>('$key', nestedValue),
);
}
return null;
}