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 ChangeNotifier { | |
10 String _firstName; | |
11 String _lastName; | |
12 List<String> _items; | |
13 | |
14 Person(this._firstName, this._lastName, this._items); | |
15 | |
16 String get firstName => _firstName; | |
17 | |
18 void set firstName(String value) { | |
19 _firstName = notifyPropertyChange(#firstName, _firstName, value); | |
20 } | |
21 | |
22 String get lastName => _lastName; | |
23 | |
24 void set lastName(String value) { | |
25 _lastName = notifyPropertyChange(#lastName, _lastName, value); | |
26 } | |
27 | |
28 String getFullName() => '$_firstName $_lastName'; | |
29 | |
30 List<String> get items => _items; | |
31 | |
32 void set items(List<String> value) { | |
33 _items = notifyPropertyChange(#items, _items, value); | |
34 } | |
35 | |
36 String toString() => "Person(firstName: $_firstName, lastName: $_lastName)"; | |
37 } | |
OLD | NEW |