2
2
// for details. All rights reserved. Use of this source code is governed by a
3
3
// BSD-style license that can be found in the LICENSE file.
4
4
5
- library uri.template;
6
-
7
5
import 'dart:collection' show UnmodifiableListView;
8
6
9
7
import 'package:quiver/pattern.dart' show escapeRegex;
@@ -212,15 +210,15 @@ class UriParser extends UriPattern {
212
210
/// See the RFC for more details.
213
211
class UriTemplate {
214
212
final String template;
215
- final List _parts;
213
+ final List < Object > _parts;
216
214
217
215
UriTemplate (this .template) : _parts = _compile (template);
218
216
219
217
@override
220
218
String toString () => template;
221
219
222
- static UnmodifiableListView _compile (String template) {
223
- final parts = [];
220
+ static UnmodifiableListView < Object > _compile (String template) {
221
+ final parts = < Object > [];
224
222
template.splitMapJoin (
225
223
_exprRegex,
226
224
onMatch: (match) {
@@ -349,7 +347,7 @@ class UriTemplate {
349
347
* over to the next _compileX method.
350
348
*/
351
349
class _Compiler {
352
- final Iterator _parts;
350
+ final Iterator < Object > _parts;
353
351
354
352
RegExp ? pathRegex;
355
353
final List <String > pathVariables = [];
@@ -412,7 +410,7 @@ class _Compiler {
412
410
}
413
411
}
414
412
415
- void _compileQuery ({Match ? match, List ? prevParts}) {
413
+ void _compileQuery ({Match ? match, List < Object > ? prevParts}) {
416
414
void handleExpressionMatch (Match match) {
417
415
final expr = match.group (3 )! ;
418
416
for (var q in expr.split (',' )) {
@@ -422,7 +420,7 @@ class _Compiler {
422
420
}
423
421
}
424
422
425
- void handleLiteralParts (List literalParts) {
423
+ void handleLiteralParts (List < Object > literalParts) {
426
424
for (var i = 0 ; i < literalParts.length; i++ ) {
427
425
final subpart = literalParts[i];
428
426
if (subpart is String ) {
@@ -464,7 +462,7 @@ class _Compiler {
464
462
}
465
463
}
466
464
467
- void _compileFragment ({Match ? match, List ? prevParts}) {
465
+ void _compileFragment ({Match ? match, List < Object > ? prevParts}) {
468
466
final fragmentBuffer = StringBuffer ();
469
467
470
468
void handleExpressionMatch (Match match) {
@@ -537,8 +535,8 @@ Map<String, String> _parseMap(String s, String separator) {
537
535
return map;
538
536
}
539
537
540
- List _splitLiteral (String literal) {
541
- final subparts = [];
538
+ List < Object > _splitLiteral (String literal) {
539
+ final subparts = < Object > [];
542
540
literal.splitMapJoin (
543
541
_fragmentOrQueryRegex,
544
542
onMatch: (m) {
0 commit comments