normalizeInputData method

Map<String, dynamic>? normalizeInputData(
  1. Object? value
)

Normalizes JSON-ish value into the inputData shape delivered to the background task handler (Map<String, dynamic> with recursively normalized nested maps and lists).

Implementation

Map<String, dynamic>? normalizeInputData(Object? value) {
  if (value == null) {
    return null;
  }
  if (value is Map) {
    final normalized = <String, dynamic>{};
    for (final entry in value.entries) {
      final key = entry.key;
      if (key is String) {
        normalized[key] = normalizeInputDataValue(entry.value);
      }
    }
    return normalized;
  }
  return <String, dynamic>{'value': normalizeInputDataValue(value)};
}