title: How to add navigation route to Card in Flutter
body: <p>In the code below, I have a method myMenu on a card. How do I navigate to another page when the card is tapped? There are going to be several of these cards which will link to its own page content. Each time I add a function to for an example it gives an error. How do I do it properly?</p>
  
  <pre><code>import 'package:flutter/material.dart';
  import 'package:tarjous_app/gridview_demo.dart';
  
  void main(List&lt;String&gt; args) {
    runApp(
        new MaterialApp(home: TarjousAle(), debugShowCheckedModeBanner: false));
  }
  
  class TarjousAle extends StatefulWidget {
    @override
    _TarjousAleState createState() =&gt; _TarjousAleState();
  }
  
  class _TarjousAleState extends State&lt;TarjousAle&gt; {
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        appBar: new AppBar(
          title: Text("Study Plan"),
          backgroundColor: Colors.amber,
        ),
        body: Container(
          child: GridView.count(
            crossAxisCount: 3,
            children: &lt;Widget&gt;[
              MyMenu(
                title: "Records",
                icon: Icons.account_balance_wallet,
                shape: Colors.brown,
              ),
              MyMenu(
                title: "Academy",
                icon: Icons.account_balance,
                shape: Colors.grey,
              ),
            ],
          ),
        ),
      );
    }
  }
  
  class MyMenu extends StatelessWidget {
    MyMenu({this.title, this.icon, this.shape});
  
    final String title;
    final IconData icon;
    final MaterialColor shape;
  
    @override
    Widget build(BuildContext context) {
      return Card(
        margin: EdgeInsets.all(9.0),
        child: InkWell(           
        onTap: () =&gt; Navigator.push(
          context,
          MaterialPageRoute(builder: (context) =&gt; GridViewDemo()),
        ),
          splashColor: Colors.amberAccent,
          child: Center(
            child: Column(
              mainAxisSize: MainAxisSize.min,
              children: &lt;Widget&gt;[
                Icon(
                  icon,
                  size: 80.0,
                  color: shape,
                ),
                Text(title, style: new TextStyle(fontSize: 18.0))
              ],
            ),
          ),
        ),
      );
    }
  }
  </code></pre>
  
  <p>In the inkwell widget, I add a function that works for all the cards. But what I really want it for each card to navigate to its own page. E.g Records should navigate to its own records page, the same thing for Academy to academy page</p>