title: error: The argument type 'Future' can't be assigned to the parameter type 'void Function()'
body: <p>While I am passing value from home page to source page it shows an error: The argument type 'Future' can't be assigned to the parameter type 'void Function()'. (argument_type_not_assignable at [<strong>strong text</strong>] 
  lib\home.dart:15)</p>
  
  <p>Where I am doing wrong??</p>
  
  <p>Home page - </p>
  
  <pre><code>import 'package:flutter/material.dart';
  import 'sourceScreen.dart';
  
  class Home extends StatefulWidget {
    int value;
    Home({this.value});
    @override
    _HomeState createState() =&gt; _HomeState();
  }
  
  class _HomeState extends State&lt;Home&gt; {
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        body: Center(
          child: FlatButton(
            onPressed: Navigator.push(context, MaterialPageRoute(builder: (context)=&gt;SourceScreen({value:value}))), child: null,
          ),
        ),
      );
    }
  }
  </code></pre>
  
  <p>Below page is where I wanna use home page value-</p>
  
  <pre><code>import 'package:flutter/material.dart';
  import 'dart:convert';
  import 'package:http/http.dart' as http;
  import 'models/model.dart';
  import 'models/card.dart';
  import 'article.dart';
  
  final API_KEY = '***';
  
  Future&lt;List&lt;Source&gt;&gt; fetchNewsSource() async {
    final response = await http.get(
        'https://newsapi.org/v2/sources?language=en&amp;country=in&amp;apiKey=$API_KEY');
  
    if (response.statusCode == 200) {
      List sources = json.decode(response.body)['sources'];
      return sources.map((source) =&gt; new Source.formJson(source)).toList();
    } else {
      throw Exception('Fail to load data');
    }
  }
  
  class SourceScreen extends StatefulWidget {
    @override
    _SourceScreenState createState() =&gt; _SourceScreenState();
  }
  
  class _SourceScreenState extends State&lt;SourceScreen&gt; {
    var list_source;
    var refreshKey = GlobalKey&lt;RefreshIndicatorState&gt;();
  
    @override
    void initState() {
      super.initState();
      refreshListSource();
    }
  
    Future&lt;Null&gt; refreshListSource() async {
      refreshKey.currentState?.show(atTop: false);
      setState(() {
        list_source = fetchNewsSource();
      });
    }
  
    @override
    Widget build(BuildContext context) {
      return MaterialApp(
        home: Scaffold(
          backgroundColor: Color.fromRGBO(58, 66, 86, 1.0),
          appBar: AppBar(
            elevation: 1.0,
            backgroundColor: Color.fromRGBO(58, 66, 86, 1.0),
            title: Text('uTTerNews'),
          ),
          body: Center(
            child: RefreshIndicator(
                child: FutureBuilder&lt;List&lt;Source&gt;&gt;(
                  future: list_source,
                  builder: (context, snapshot) {
                    if (snapshot.hasError) {
                      Text('Error: ${snapshot.error}');
                    } else if (snapshot.hasData) {
                      List&lt;Source&gt; sources = snapshot.data;
                      return new ListView(
                          children: sources
                              .map((source) =&gt;
                              GestureDetector(
                                onTap: () {
                                  Navigator.push(context, MaterialPageRoute(
                                      builder: (context) =&gt;
                                          articleScreen(source: source,)));
                                },
                                child: card(source),
                              ))
                              .toList());
                    }
                    return CircularProgressIndicator();
                  },
                ),
                onRefresh: refreshListSource),
          ),
        ),
      );
    }
  }
  </code></pre>