Line data Source code
1 : import '../../../routemaster.dart'; 2 : 3 : class RouterResult { 4 : /// The builder matching the path 5 : final PageBuilder builder; 6 : 7 : /// Path parameters matched in this path section 8 : /// e.g. '/blah/:id' becomes `pathParameters['id']` 9 : final Map<String, String> pathParameters; 10 : 11 : /// The path for this path segment. This isn't the complete path requested. 12 : /// e.g. a look up for '/blah/test' will return 3 RouterResults with paths: 13 : /// 1. / 14 : /// 2. /blah 15 : /// 3. /blah/test 16 : final String pathSegment; 17 : 18 11 : const RouterResult(this.builder, this.pathParameters, this.pathSegment); 19 : 20 1 : @override 21 2 : int get hashCode => pathSegment.hashCode; 22 : 23 1 : @override 24 : bool operator ==(Object other) { 25 4 : return other is RouterResult && pathSegment == other.pathSegment; 26 : } 27 : 28 1 : @override 29 : String toString() { 30 3 : return "RouterData - path: '$pathSegment', params: '$pathParameters'"; 31 : } 32 : }