title: How to mock a future method and not get type 'Null' is not a subtype of type 'Future<>' in flutter
body: <p>I want to mock this class and this specific method</p>
  <pre><code>class FeedApiService extends ApiService {
    Future&lt;FeedResponse&gt; fetchFeed(Map&lt;String, String&gt; params) async {
      ...
    }
    ...
  }
  </code></pre>
  <p>My unit test is like this</p>
  <pre><code>class FeedApiServiceMock extends Mock implements FeedApiService {}
  void main() {
    test('..', () {
      FeedApiServiceMock feedApiServiceMock = FeedApiServiceMock();
      when(feedApiServiceMock.fetchFeed({})).thenAnswer(
          (_) =&gt; Future.value(FeedResponse(items: 1)),
        );
      expect(await feedApiServiceMock.fetchFeed({}).items, 1);
    });
  }
  </code></pre>
  <p>I just want to see that fetch feed is mocked correctly, but I'm getting this error:</p>
  <pre><code>type 'Null' is not a subtype of type 'Future&lt;FeedResponse&gt;'
  </code></pre>