ReactiveX / rxdart

The Reactive Extensions for Dart
http://reactivex.io
Apache License 2.0
3.37k stars 271 forks source link

[BUG]RxDart Example github_search error #628

Closed wayne900204 closed 3 years ago

wayne900204 commented 3 years ago

https://github.com/ReactiveX/rxdart/blob/master/example/flutter/github_search/lib/search_bloc.dart#L37-L43

if i change to

  static Stream<SearchState> _search(String term, GithubApi api) => term.isEmpty
      ? Stream.value(SearchNoTerm())
      : Rx.fromCallable(() => api.search(term).catchError((e) {
                print(e.toString());
              }))
          .map((result) =>
              result.isEmpty ? SearchEmpty() : SearchPopulated(result))
          .startWith(SearchLoading())
          .onErrorReturn(SearchError());

It will get an exception

Screen Shot 2021-09-13 at 10 34 03 PM

flutter: type '_InternalLinkedHashMap<String, dynamic>' is not a subtype of type 'Map<String, Object>'

My Flutter environment is it

environment:
  sdk: ">=2.12.0 <3.0.0"