Case.merge constructor Null safety

Case.merge(
  1. Case value,
  2. Case other
)

Implementation

factory Case.merge(Case value, Case other) {
  assert(value.condition == other.condition,
      'Two merge cases should have the same condition');

  final result = Case(
    condition: value.condition,
    translations: [
      ...value.translations,
      ...other.translations.where((o) =>
          !value.translations.any((v) => v.languageCode == o.languageCode))
    ],
  );

  Logger.root.finer(
      '[{CASE} Merging]:\n\n\tITEM1===================================\n$value\n\n\tITEM2===================================\n$other\n\n\tRESULT===================================:\n$result\n\n');

  return result;
}