If your regexp contains only one group (like new RegExp(r'(\S+)')) you can rewrite your function to:
new RegExp(r'(\S+)')
Iterable<String> _allStringMatches(String text, RegExp regExp) => regExp.allMatches(text).map((m) => m.group(0));