5

以下のクラスに適用されるように、 Observable を持つ extends Object と extends 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;
  }
}
4

1 に答える 1