mapAsync method

  1. @override
Future<PFormData> mapAsync(
  1. FormData source
)

Asynchronously maps a source object to the target type

source - The source object to map

Implementation

@override
Future<PFormData> mapAsync(FormData source) async {
  final mappedFiles = <String, PFormFile>{};
  for (final entry in source.files.entries) {
    mappedFiles[entry.key] = await mapper.mapAsync(entry.value);
  }

  return PFormData(
    fields: source.fields,
    files: mappedFiles,
  );
}