OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 part of dartiverse_search; | 5 part of dartiverse_search; |
6 | 6 |
7 | 7 |
8 class StackOverflowSearchEngine { | 8 class StackOverflowSearchEngine { |
9 String get name => 'StackOverflow'; | 9 String get name => 'StackOverflow'; |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 json['items'].take(3).forEach((item) { | 30 json['items'].take(3).forEach((item) { |
31 controller.add(new SearchResult( | 31 controller.add(new SearchResult( |
32 item['title'], item['link'])); | 32 item['title'], item['link'])); |
33 }); | 33 }); |
34 }) | 34 }) |
35 .catchError(controller.addError) | 35 .catchError(controller.addError) |
36 .whenComplete(controller.close); | 36 .whenComplete(controller.close); |
37 return controller.stream; | 37 return controller.stream; |
38 } | 38 } |
39 } | 39 } |
OLD | NEW |