title: How to use Dart ChangeNotifier class?
body: <p>I'm exploring the ChangeNotifier class in Dart's observe library for use in a commandline application. But, I'm having two issues.</p>
  <ol>
  <li><p>The number of reported changes in a <code>List&lt;ChangeRecord&gt;</code> object are incrementally repeated in each update to the record. See image:</p>
  <p><img src="https://i.stack.imgur.com/BuRZs.png" alt="enter image description here" /></p>
  </li>
  <li><p>ChangeRecord doesn't allow for retrieving only new values. Thus, I'm trying to use a MapChangeRecord instead. But, I don't know how to use it.</p>
  </li>
  </ol>
  <p>This is my sample code for reference:</p>
  <pre class="lang-dart prettyprint-override"><code>import 'dart:io';
  import 'dart:async';
  import 'dart:convert';
  import 'package:observe/observe.dart';
  
  class Notifiable extends Object with ChangeNotifier {
    String _input = ''; 
    @reflectable get input =&gt; _input;
    @reflectable set input(val) {
      _input = notifyPropertyChange(#input, _input, val);
    }
    
    void change(String text) {
      input = text;
      this.changes.listen((List&lt;ChangeRecord&gt; record) =&gt; print(record.last));
    }
  }
  
  void main() {
    Notifiable notifiable = new Notifiable();
    Stream stdinStream = stdin;
    stdinStream
      .transform(new Utf8Decoder())
        .listen((e) =&gt; notifiable.change(e));
  }
  </code></pre>