splitIntoSubstrings method
Implementation
@visibleForTesting
List<String> splitIntoSubstrings(String text) {
final List<String> substrings = [];
final RegExp regex = RegExp(r'(\{(?:[^{}]|\{[^{}]*\})*\}|[^{}]+)');
final Iterable<Match> matches = regex.allMatches(text);
for (final Match match in matches) {
substrings.add(match.group(0)!);
}
return substrings;
}