copyWith method Null safety

bool copyWith(
  1. UnreadCountInfo others
)

Implementation

bool copyWith(UnreadCountInfo others) {
  var didChange = false;

  ts = others.ts;

  others.customTypes.forEach((key, value) {
    final currValue = customTypes[key];
    if (currValue != value) {
      didChange = true;
      customTypes[key] = value;
    }
  });

  if (all != others.all) {
    didChange = true;
    all = others.all;
  }

  return didChange;
}