| OLD | NEW |
| 1 | 1 |
| 2 library pets; | 2 library pets; |
| 3 | 3 |
| 4 import 'dart:isolate'; | 4 import 'dart:isolate'; |
| 5 import 'dart:math'; | 5 import 'dart:math'; |
| 6 | 6 |
| 7 final num MAX_CATS = 10; | 7 final num MAX_CATS = 10; |
| 8 | 8 |
| 9 final SPARKY = const Cat("Sparky"); | 9 final SPARKY = const Cat("Sparky"); |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 final String name; | 23 final String name; |
| 24 | 24 |
| 25 final bool _declawed = false; | 25 final bool _declawed = false; |
| 26 | 26 |
| 27 const Cat(this.name); | 27 const Cat(this.name); |
| 28 | 28 |
| 29 bool livesWith(Animal other) => other is Cat; | 29 bool livesWith(Animal other) => other is Cat; |
| 30 | 30 |
| 31 final String _color = "blue"; | 31 final String _color = "blue"; |
| 32 | 32 |
| 33 String get color { | 33 String get color { |
| 34 return _color; | 34 return _color; |
| 35 } | 35 } |
| 36 | 36 |
| 37 set color(String val) { | 37 set color(String val) { |
| 38 // nothing to do | 38 // nothing to do |
| 39 val = "${val}"; | 39 val = "${val}"; |
| 40 } | 40 } |
| 41 | 41 |
| 42 void performAction() { | 42 void performAction() { |
| 43 print("m${_eo()}w"); | 43 print("m${_eo()}w"); |
| 44 } | 44 } |
| 45 | 45 |
| 46 String toString() => "cat ${name}"; | 46 String toString() => "cat ${name}"; |
| 47 | 47 |
| 48 String _eo() { | 48 String _eo() { |
| 49 return "eo"; | 49 return "eo"; |
| 50 } | 50 } |
| 51 } | 51 } |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 | 192 |
| 193 // should display as null | 193 // should display as null |
| 194 var bob = null; | 194 var bob = null; |
| 195 | 195 |
| 196 // TODO: empty lists | 196 // TODO: empty lists |
| 197 var emptyList = []; | 197 var emptyList = []; |
| 198 | 198 |
| 199 // TODO: empty maps | 199 // TODO: empty maps |
| 200 var emptyMap = {}; | 200 var emptyMap = {}; |
| 201 | 201 |
| 202 // display sets (_HashSetImpl) | 202 // display sets (HashSet) |
| 203 var set = new Set(); | 203 var set = new Set(); |
| 204 set.add(1); | 204 set.add(1); |
| 205 set.add(2); | 205 set.add(2); |
| 206 set.add(2); | 206 set.add(2); |
| 207 set.add("what"); | 207 set.add("what"); |
| 208 | 208 |
| 209 print("types"); | 209 print("types"); |
| 210 } | 210 } |
| 211 | 211 |
| 212 void createARealBigArray() { | 212 void createARealBigArray() { |
| 213 var arr = new List<int>(120); | 213 var arr = new List<int>(120); |
| 214 | 214 |
| 215 for (int i = 0; i < arr.length; i++) { | 215 for (int i = 0; i < arr.length; i++) { |
| 216 arr[i] = i * 10; | 216 arr[i] = i * 10; |
| 217 } | 217 } |
| 218 | 218 |
| 219 print("big array created"); | 219 print("big array created"); |
| 220 | 220 |
| 221 arr[0] = "assdsdf"; | 221 arr[0] = "assdsdf"; |
| 222 | 222 |
| 223 arr[0]++; | 223 arr[0]++; |
| 224 } | 224 } |
| OLD | NEW |