copyWith method

NaturalLanguage copyWith({
  1. String? name,
  2. String? code,
  3. String? codeShort,
  4. List<String>? namesNative,
  5. String? bibliographicCode,
  6. NaturalLanguageFamily? family,
  7. bool? isRightToLeft,
  8. Set<Script>? scripts,
})

Creates a new instance of NaturalLanguage with updated properties.

The optional named parameters can be used to specify new values for the corresponding properties. If a named parameter is not provided, the corresponding property is copied from the original instance.

Example usage:

const english = LangEng();

final americanEnglish = english.copyWith(
  name: 'American English',
);

Implementation

NaturalLanguage copyWith({
  String? name,
  String? code,
  String? codeShort,
  List<String>? namesNative,
  String? bibliographicCode,
  NaturalLanguageFamily? family,
  bool? isRightToLeft,
  Set<Script>? scripts,
}) =>
    NaturalLanguage(
      name: name ?? this.name,
      codeShort: codeShort ?? this.codeShort,
      namesNative: namesNative ?? this.namesNative,
      code: code ?? this.code,
      bibliographicCode: bibliographicCode ?? this.bibliographicCode,
      family: family ?? this.family,
      isRightToLeft: isRightToLeft ?? this.isRightToLeft,
      scripts: scripts ?? this.scripts,
    );