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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 @reflectable |
86 class Person extends ChangeNotifierBase { | 86 class Person extends ChangeNotifier { |
87 String _firstName; | 87 String _firstName; |
88 String _lastName; | 88 String _lastName; |
89 List<String> _items; | 89 List<String> _items; |
90 | 90 |
91 Person(this._firstName, this._lastName, this._items); | 91 Person(this._firstName, this._lastName, this._items); |
92 | 92 |
93 String get firstName => _firstName; | 93 String get firstName => _firstName; |
94 | 94 |
95 void set firstName(String value) { | 95 void set firstName(String value) { |
96 _firstName = notifyPropertyChange(#firstName, _firstName, value); | 96 _firstName = notifyPropertyChange(#firstName, _firstName, value); |
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 = notifyPropertyChange(#lastName, _lastName, value); | 102 _lastName = notifyPropertyChange(#lastName, _lastName, value); |
103 } | 103 } |
104 | 104 |
105 String getFullName() => '$_firstName $_lastName'; | 105 String getFullName() => '$_firstName $_lastName'; |
106 | 106 |
107 List<String> get items => _items; | 107 List<String> get items => _items; |
108 | 108 |
109 void set items(List<String> value) { | 109 void set items(List<String> value) { |
110 _items = notifyPropertyChange(#items, _items, value); | 110 _items = notifyPropertyChange(#items, _items, value); |
111 } | 111 } |
112 | 112 |
113 String toString() => "Person(firstName: $_firstName, lastName: $_lastName)"; | 113 String toString() => "Person(firstName: $_firstName, lastName: $_lastName)"; |
114 } | 114 } |
OLD | NEW |