title: How to ontap screen listener in flutter
body: <p>How to on tap screen listener in flutter which increments the number on the screen.I try this code which is below and it increments the number but by tapping at the middle of the screen,what is the code so that where i tap anywhere on the screen and it increment by 1.</p>
  
  <pre><code>class _MyHomePageState extends State&lt;MyHomePage&gt; {
    int counter=0;
    void _increment(){
      setState(() {
        counter++;
      });
    }
    @override
    Widget build(BuildContext context) {
      return new Scaffold(
        appBar: new AppBar(
          title: new Text("Flutter Counter"),
        ),
        body: GestureDetector(
          onTap: () {
            setState(() { _increment(); });
          },
          child: Center(
            child: Text('$counter'),
          ),
        )
  </code></pre>