getDictionaryWarning method

String? getDictionaryWarning(
  1. DictionaryGuess match,
  2. bool isSoleMatch
)

Implementation

String? getDictionaryWarning(DictionaryGuess match, bool isSoleMatch) {
  String? warning;
  final String dictName = match.dictionaryName;
  final isAName = dictName == 'lastnames' ||
      dictName.toLowerCase().contains('firstnames');

  if (dictName == 'passwords') {
    warning = getDictionaryWarningPassword(match, isSoleMatch);
  } else if (dictName.contains('wikipedia')) {
    warning = getDictionaryWarningWikipedia(match, isSoleMatch);
  } else if (isAName) {
    warning = getDictionaryWarningNames(match, isSoleMatch);
  } else if (dictName == 'userInputs') {
    warning = zxcvbn.options.translations.warnings.userInputs;
  }

  return warning;
}