extractPlaceholders method

List<PlaceholderMatch> extractPlaceholders(
  1. String text
)

Implementation

List<PlaceholderMatch> extractPlaceholders(String text) {
  final matches = RegExp(_placeholderRegex).allMatches(text).toList();
  return matches.map((match) {
    final matchedStr = text.substring(match.start, match.end);
    final content = matchedStr.substring(1, matchedStr.length - 1);
    return PlaceholderMatch(match.start, match.end, content);
  }).toList();
}