copyIfSet<T> method

void copyIfSet<T>(
  1. Map<String, dynamic> source,
  2. String sourceKey,
  3. Map<String, dynamic> dest,
  4. String destKey,
)

Implementation

void copyIfSet<T>(
  Map<String, dynamic> source,
  String sourceKey,
  Map<String, dynamic> dest,
  String destKey,
) {
  final value = source.takeOr<T>(sourceKey);
  if (value != null) dest[destKey] = value;
}