Line data Source code
1 : import 'package:path/path.dart' as path; 2 : 3 : /// Indicates the user has configured their routes improperly. 4 : class RouteConfigurationError extends Error {} 5 : 6 : class ConflictingPathError extends RouteConfigurationError { 7 : final Iterable<String> segmentsToAdd; 8 : final Iterable<String?> segmentsAlreadyAdded; 9 : 10 1 : ConflictingPathError(this.segmentsToAdd, this.segmentsAlreadyAdded); 11 : 12 1 : @override 13 : String toString() { 14 3 : return "Attempt to add '${path.joinAll(segmentsToAdd)}' but a path containing " 15 6 : "'${path.joinAll(segmentsAlreadyAdded.where((element) => element != null).map((e) => e!))}' has already been added. Adding two paths " 16 : "prefixed with ':' at the same index is not allowed."; 17 : } 18 : }