title: Observable to BehaviorSubject Flutter
body: <p>I'm new to rx so it is possible that I might be doing something terribly wrong. </p>
  
  <p>I'm trying to convert an observable to a BehaviorSubject since I'd like to have:<br>
  - multiple observers<br>
  - initial value  </p>
  
  <pre><code>Observable&lt;Note&gt; _observableResult;
  BehaviorSubject&lt;Note&gt; result;
  
   Observable&lt;FileSystemEntity&gt; getContentOfDirectory(file) {
  final dir = Directory(file);
  try {
    var stream = dir
        .list(recursive: false, followLinks: false)
        .where((fse) =&gt; !fse.path.contains("DS_Store"));
    return Observable(stream);
  } catch (e) {
    debugPrint('getNoteError: $e');
    // If encountering an error, return 0
    return Observable.just(null);
  }
  }
  
  
  getNotes() async {
  final file = await _localPath;//Future&lt;String&gt;
  
  _observableResult = getContentOfDirectory(file)
      .asyncMap((fse) {
        if (fse is File) {
          return fse.readAsString();
        } else {
          return null;
        }
      })
      .where((e) =&gt; e != null)
      .asyncMap((s) =&gt; Note.fromJsonResponse(s));
  
  result =
      BehaviorSubject().withLatestFrom(_observableResult, (one, two) =&gt; two);
    }
  </code></pre>
  
  <p>Error:
  Observable is not a subtype of type BehaviorSubject</p>
  
  <p>Obviously combineLatest is not right(?), but I did not find any decent way to convert between them...</p>