1

I'm using go router package for routing.And trying to open seperate pages with the id when clicking on the page

my function inside my homepage.dart

Widget buildImage(String urlImage, String title, int price, double padding,
        int index, String id) => 
    GestureDetector(
      onTap: () {
        context.go(); **//this is returning context is undefined**
      },
      child: Container(
        child: Padding(
          padding: EdgeInsets.only(left: 20.0),
          child: Container(
             ...
          ),
        ),
      ),
    );

I want to be able to use context to navigate to my page with the id.

Mohammed Malek
  • 164
  • 1
  • 9

0 Answers0