How do I make my OnTap to move to a new screen?

222 views Asked by At

This is part of my code, when I tap it does not move to MathYear() page

GestureDetector(
                onTap: (){
                  Navigator.push(context,
                      MaterialPageRoute(builder: (context) => MathYear() ),
                  );
                },
                child: Card(
                  color: Color(0xffb0dab9),
                  elevation: 5,
                  child: Row(
                      children:<Widget>[
                        Container( margin : EdgeInsets.all(20), child:  Icon(Icons.calculate)),
                        Text ("Mathemathics")
                      ]

Handler: "onTap" Recognizer: TapGestureRecognizer#27ce0 debugOwner: GestureDetector state: ready won arena finalPosition: Offset(213.3, 415.7) finalLocalPosition: Offset(197.3, 22.4) button: 1 sent tap down

0

There are 0 answers