使用 Observable 扩展 Object 和将 Observable 应用于下面的类有什么区别。
运行应用程序时的结果是相同的。
library models;
import 'package:polymer/polymer.dart';
class Person extends Object with Observable {
@observable String name;
@observable bool signedAgreement = false;
Person();
Person.from(Person other) {
name = other.name;
signedAgreement = other.signedAgreement;
}
blank() {
name = '';
signedAgreement = false;
}
}
library models;
import 'package:polymer/polymer.dart';
class Person extends Observable {
@observable String name;
@observable bool signedAgreement = false;
Person();
Person.from(Person other) {
name = other.name;
signedAgreement = other.signedAgreement;
}
blank() {
name = '';
signedAgreement = false;
}
}