copyWith method
Creates a new instance with updated values.
Implementation
Options copyWith({
List<BaseMatcher>? matchers,
Set<Dictionaries>? dictionaries,
List<String>? userInputs,
L33tTable? l33tTable,
Graph? graph,
bool? useLevenshteinDistance,
int? levenshteinThreshold,
int? l33tMaxSubstitutions,
int? maxLength,
}) {
dictionaries ??= this.dictionaries;
final Set<Dictionaries> newDictionaries = <Dictionaries>{
...dictionaries,
if (userInputs != null)
<Dictionary, List<String>>{Dictionary.userInputs: userInputs},
};
return Options(
matchers: matchers ?? this.matchers,
dictionaries: newDictionaries,
l33tTable: l33tTable ?? this.l33tTable,
graph: graph ?? this.graph,
useLevenshteinDistance:
useLevenshteinDistance ?? this.useLevenshteinDistance,
levenshteinThreshold: levenshteinThreshold ?? this.levenshteinThreshold,
l33tMaxSubstitutions: l33tMaxSubstitutions ?? this.l33tMaxSubstitutions,
maxLength: maxLength ?? this.maxLength,
);
}