| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 | 5 |
| 6 // Demonstrates: | 6 // Demonstrates: |
| 7 // list, maps, random, strings, string interpolation | 7 // list, maps, random, strings, string interpolation |
| 8 // cascade, fat arrow, ternary operator | 8 // cascade, fat arrow, ternary operator |
| 9 // named constructors | 9 // named constructors |
| 10 // optional parameters | 10 // optional parameters |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 return HttpRequest.getString(path) | 142 return HttpRequest.getString(path) |
| 143 .then(_parsePirateNamesFromJSON); | 143 .then(_parsePirateNamesFromJSON); |
| 144 } | 144 } |
| 145 | 145 |
| 146 static _parsePirateNamesFromJSON(String jsonString) { | 146 static _parsePirateNamesFromJSON(String jsonString) { |
| 147 Map pirateNames = JSON.decode(jsonString); | 147 Map pirateNames = JSON.decode(jsonString); |
| 148 names = pirateNames['names']; | 148 names = pirateNames['names']; |
| 149 appellations = pirateNames['appellations']; | 149 appellations = pirateNames['appellations']; |
| 150 } | 150 } |
| 151 } | 151 } |
| OLD | NEW |