title: How can I use onTap in GridView?
body: <p>I want to use onTap() with GridView and searched in google.</p>
  <p>But I did not apply this code.</p>
  <p>Therefore could you suggest any solutions?</p>
  <p>Recently I started use Flutter and programming.</p>
  <p>I think that my question is abstract, so If you have any questions regarding this.</p>
  <p>Please feel free to ask me.</p>
  <p>Thanks</p>
  <pre><code>class MyHomePage extends StatefulWidget {
  
    MyHomePage({Key key, this.title}) : super(key: key);
  
  
    final String title;
  
    @override
    _MyHomePageState createState() =&gt; _MyHomePageState();
  }
  
  class _MyHomePageState extends State&lt;MyHomePage&gt; {
  
    @override
    Widget build(BuildContext context) {
  
      return Scaffold(
        appBar: AppBar(
  
          title: Text(widget.title,
                      style: TextStyle(fontFamily: 'OpenSans'),
                     ),
          centerTitle: true,
        ),
  
        body: Container(
  
          child: Padding(
            padding: const EdgeInsets.all(10.0),
  
            child: Column(
  
              children: &lt;Widget&gt; [
  
                GridView.count(
  
                  primary: true,
                  padding: const EdgeInsets.all(20),
                  crossAxisSpacing: 10,
                  mainAxisSpacing: 10,
                  crossAxisCount: 2,
                  shrinkWrap: true,
  
                 children: &lt;Widget&gt;[
  
                    Container(
                      padding: const EdgeInsets.all(8),
                      child: const Text(&quot;He'd have you all unravel at the&quot;),
                      color: Colors.teal[100],
                      
                    ),
  
                    Container(
                      padding: const EdgeInsets.all(8),
                      child: const Text('Heed not the rabble'),
                      color: Colors.teal[200],
  
                    ),
                    Container(
                      padding: const EdgeInsets.all(8),
                      child: const Text('Sound of screams but the'),
                      color: Colors.teal[300],
                    ),
                  ],
                ),
              ],
            ),
          )
            ),
      );
    }
  }
  </code></pre>