Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

The named parameter 'onTap' isn't defined in my code

I currently learning Flutter and I’m very new to it. I wanted to go to another page when tap on this text but my bad it gives me this error.

  return Expanded(
    flex: 1,
    child: Row(
      mainAxisAlignment: MainAxisAlignment.spaceBetween,
      children: <Widget>[
        GestureDetector(
          oneTap: () { // i got error here
            Navigator.push(context, MaterialPageRoute(builder: (context) => SingUpPage()));
          },
          child: Text(
            'Sing up',
            style: GoogleFonts.openSans(
                fontSize: 18,
                fontWeight: FontWeight.w700,
                decoration: TextDecoration.underline),
          ),
        ),
        Text(
          'Forgot Password',
          style: GoogleFonts.openSans(
              fontSize: 18,
              fontWeight: FontWeight.w700,
              decoration: TextDecoration.underline),
        )
      ],
    ),
  );
}

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

You are making a typo/mistake on oneTap, change it to onTap.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading