Word count for text
static int wordCount(String text) { return text.trim().split(RegExp(r'\s+')).where((word) => word.isNotEmpty).length; }