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 import 'dart:async'; | 5 import 'dart:async'; |
6 import 'dart:html'; | 6 import 'dart:html'; |
7 | 7 |
8 import 'package:mdv/mdv.dart' as mdv; | 8 import 'package:mdv/mdv.dart' as mdv; |
9 import 'package:logging/logging.dart'; | 9 import 'package:logging/logging.dart'; |
10 import 'package:observe/observe.dart'; | 10 import 'package:observe/observe.dart'; |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 expect(records.length, 1); | 75 expect(records.length, 1); |
76 expect(records.first.message, | 76 expect(records.first.message, |
77 contains('Error evaluating expression')); | 77 contains('Error evaluating expression')); |
78 expect(records.first.message, contains('foo')); | 78 expect(records.first.message, contains('foo')); |
79 }); | 79 }); |
80 }); | 80 }); |
81 }); | 81 }); |
82 }); | 82 }); |
83 } | 83 } |
84 | 84 |
| 85 @reflectable |
85 class Person extends ChangeNotifierBase { | 86 class Person extends ChangeNotifierBase { |
86 String _firstName; | 87 String _firstName; |
87 String _lastName; | 88 String _lastName; |
88 List<String> _items; | 89 List<String> _items; |
89 | 90 |
90 Person(this._firstName, this._lastName, this._items); | 91 Person(this._firstName, this._lastName, this._items); |
91 | 92 |
92 String get firstName => _firstName; | 93 String get firstName => _firstName; |
93 | 94 |
94 void set firstName(String value) { | 95 void set firstName(String value) { |
95 _firstName = value; | 96 _firstName = notifyPropertyChange(#firstName, _firstName, value); |
96 notifyChange(new PropertyChangeRecord(#firstName)); | |
97 } | 97 } |
98 | 98 |
99 String get lastName => _lastName; | 99 String get lastName => _lastName; |
100 | 100 |
101 void set lastName(String value) { | 101 void set lastName(String value) { |
102 _lastName = value; | 102 _lastName = notifyPropertyChange(#lastName, _lastName, value); |
103 notifyChange(new PropertyChangeRecord(#lastName)); | |
104 } | 103 } |
105 | 104 |
106 String getFullName() => '$_firstName $_lastName'; | 105 String getFullName() => '$_firstName $_lastName'; |
107 | 106 |
108 List<String> get items => _items; | 107 List<String> get items => _items; |
109 | 108 |
110 void set items(List<String> value) { | 109 void set items(List<String> value) { |
111 _items = value; | 110 _items = notifyPropertyChange(#items, _items, value); |
112 notifyChange(new PropertyChangeRecord(#items)); | |
113 } | 111 } |
114 | 112 |
115 String toString() => "Person(firstName: $_firstName, lastName: $_lastName)"; | 113 String toString() => "Person(firstName: $_firstName, lastName: $_lastName)"; |
116 | |
117 } | 114 } |
OLD | NEW |