makeUri method

String makeUri (
  1. Map<String, dynamic> params
)

Implementation

String makeUri(Map<String, dynamic> params) {
  var b = StringBuffer();
  int i = 0;

  for (var seg in _routeDefinition.segments) {
    if (i++ > 0) b.write('/');
    if (seg is ConstantSegment) {
      b.write(seg.text);
    } else if (seg is ParameterSegment) {
      if (!params.containsKey(seg.name)) {
        throw ArgumentError('Missing parameter "${seg.name}".');
      }
      b.write(params[seg.name]);
    }
  }

  return b.toString();
}