merge method

FormErrors merge(
  1. FormErrors other
)

Combines this error collection with other.

Implementation

FormErrors merge(FormErrors other) {
  if (other.isEmpty) return this;
  if (isEmpty) return other;

  return FormErrors({
    ..._messages,
    for (final entry in other._messages.entries)
      entry.key: [...(_messages[entry.key] ?? const []), ...entry.value],
  });
}