WordPair.random constructor
WordPair.random({})
Creates a single WordPair randomly. Takes the same parameters as generateWordPairs.
If you need more than one word pair, this constructor will be inefficient. Get an iterable of random word pairs instead by calling generateWordPairs.
Implementation
factory WordPair.random(
{int maxSyllables = maxSyllablesDefault,
int top = topDefault,
bool safeOnly = safeOnlyDefault,
Random? random}) {
random ??= _random;
final pairsIterable = generateWordPairs(
maxSyllables: maxSyllables,
top: top,
safeOnly: safeOnly,
random: random);
return pairsIterable.first;
}