title: Async request using BLoC in Flutter
body: <p>I would like download the data, but also use the application all the time.</p>
  
  <p>Can you tell me if it's right solution?</p>
  
  <p>The case is we press button download and call funtion bloc.dispatch(Event.download());</p>
  
  <p>In mapEventToState in _Download event we reqest data. But we don't wait for response because we don't want to block others events which are changing view.</p>
  
  <p>So I create Future and after getting response I call event _UpdateData() where I process downloaded data and generate state with them. </p>
  
  <p>It's ok?
  There is _requestTime parameter to check if it's last request.</p>
  
  <pre><code>class Bloc {
    DateTime _requestTime;
  
    @override
    Stream&lt;State&gt; mapEventToState(Event event) async* {
      if (event is _Download) {
        yield DownloadingState();
        _request();
      } else if (event is _UpdateData) {
        if(!event.requestTime.isBefore(_requestTime))
          yield DownladedState(event.response);
      }
    }
  
    _request() {
      _requestTime = DateTime.now();
      repository.downloadData().then((response) {
        dispatch(_UpdateData(response));
      });
    }
  }
  </code></pre>