blob: d561fac4b0fa01b7d198ca1031c2e373f948c0ff [file] [log] [blame]
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
library person;
import 'package:observe/observe.dart';
class Person extends ChangeNotifierBase {
static const _FIRST_NAME = const Symbol('firstName');
static const _LAST_NAME = const Symbol('lastName');
static const _ITEMS = const Symbol('items');
static const _GET_FULL_NAME = const Symbol('getFullName');
String _firstName;
String _lastName;
List<String> _items;
Person(this._firstName, this._lastName, this._items);
String get firstName => _firstName;
void set firstName(String value) {
_firstName = value;
notifyChange(new PropertyChangeRecord(_FIRST_NAME));
}
String get lastName => _lastName;
void set lastName(String value) {
_lastName = value;
notifyChange(new PropertyChangeRecord(_LAST_NAME));
}
String getFullName() => '$_firstName $_lastName';
List<String> get items => _items;
void set items(List<String> value) {
_items = value;
notifyChange(new PropertyChangeRecord(_ITEMS));
}
String toString() => "Person(firstName: $_firstName, lastName: $_lastName)";
}