randomWord method

String randomWord()

Implementation

String randomWord() {
  final wordType = _pickOne(Dictionary.mixWeighting);
  final types = [Dictionary.kanji, Dictionary.hiragana, Dictionary.katakana];
  final type = types[wordType - 1];
  final length = type['text']!.toList().length - 1;
  final word = type['text']![_randomInteger(0, length)] as String;
  return word;
}