toParams method

List<String> toParams()

Parses the string into a list of route parameters.

Implementation

List<String> toParams() {
  final regexp = RegExp(r'\[(.*?)\]');
  final matches = regexp.allMatches(this);
  return matches.map((m) {
    final match = m[0]!;
    return match.replaceAll(RegExp(r'\[|\]'), '').replaceFirst('...', '');
  }).toList();
}