copyWith method

Country copyWith({
  1. String? dialCode,
  2. String? displayCC,
  3. String? flag,
  4. String? fullCountryCode,
  5. int? minLength,
  6. int? maxLength,
  7. String? name,
  8. String? regionCode,
  9. String? pattern,
})

Create a copy with optional field overrides

Implementation

Country copyWith({
  String? dialCode,
  String? displayCC,
  String? flag,
  String? fullCountryCode,
  int? minLength,
  int? maxLength,
  String? name,
  String? regionCode,
  String? pattern,
}) {
  return Country(
    code: code,
    dialCode: dialCode ?? this.dialCode,
    displayCC: displayCC ?? this.displayCC,
    flag: flag ?? this.flag,
    fullCountryCode: fullCountryCode ?? this.fullCountryCode,
    minLength: minLength ?? this.minLength,
    maxLength: maxLength ?? this.maxLength,
    name: name ?? this.name,
    regionCode: regionCode ?? this.regionCode,
    pattern: pattern ?? this.pattern,
  );
}