getWordCount method

int getWordCount()

Implementation

int getWordCount() => trim()
    .split(RegExp(r'\s+'))
    .where((String word) => word.isNotEmpty)
    .length;