| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 library person; |
| 6 |
| 7 import 'package:observe/observe.dart'; |
| 8 |
| 9 class Person extends ChangeNotifierBase { |
| 10 static const _FIRST_NAME = const Symbol('firstName'); |
| 11 static const _LAST_NAME = const Symbol('lastName'); |
| 12 static const _ITEMS = const Symbol('items'); |
| 13 static const _GET_FULL_NAME = const Symbol('getFullName'); |
| 14 |
| 15 String _firstName; |
| 16 String _lastName; |
| 17 List<String> _items; |
| 18 |
| 19 Person(this._firstName, this._lastName, this._items); |
| 20 |
| 21 String get firstName => _firstName; |
| 22 |
| 23 void set firstName(String value) { |
| 24 _firstName = value; |
| 25 notifyChange(new PropertyChangeRecord(_FIRST_NAME)); |
| 26 } |
| 27 |
| 28 String get lastName => _lastName; |
| 29 |
| 30 void set lastName(String value) { |
| 31 _lastName = value; |
| 32 notifyChange(new PropertyChangeRecord(_LAST_NAME)); |
| 33 } |
| 34 |
| 35 String getFullName() => '$_firstName $_lastName'; |
| 36 |
| 37 List<String> get items => _items; |
| 38 |
| 39 void set items(List<String> value) { |
| 40 _items = value; |
| 41 notifyChange(new PropertyChangeRecord(_ITEMS)); |
| 42 } |
| 43 |
| 44 String toString() => "Person(firstName: $_firstName, lastName: $_lastName)"; |
| 45 |
| 46 } |
| OLD | NEW |