toPath method

  1. @override
String toPath(
  1. Map<String, String> args
)
override

Returns the path representation of this given args.

Implementation

@override
String toPath(Map<String, String> args) {
  final value = args[name];
  if (value != null) {
    if (!regExp.hasMatch(value)) {
      throw ArgumentError.value('$args', 'args',
          'Expected "$name" to match "$pattern", but got "$value"');
    }
    return value;
  } else {
    throw ArgumentError.value('$args', 'args', 'Expected key "$name"');
  }
}