copyWith method
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? bibliographicCode,
String? code,
String? codeShort,
NaturalLanguageFamily? family,
bool? isRightToLeft,
String? name,
List<String>? namesNative,
Set<Script>? scripts,
/// {@macro sealed_world.locale_mapper_callback}
LocaleMapFunction<String> Function()? mapper,
}) => LangCustom(
name: name ?? this.name,
codeShort: codeShort ?? this.codeShort,
namesNative: namesNative ?? this.namesNative,
code: code ?? this.code,
bibliographicCode: (bibliographicCode?.isEmpty ?? false)
? null
: (bibliographicCode ?? this.bibliographicCode),
family: family ?? this.family,
isRightToLeft: isRightToLeft ?? this.isRightToLeft,
scripts: scripts ?? this.scripts,
mapper: mapper ?? l10n.mapper,
);