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 :
You are making a typo/mistake on oneTap, change it to onTap.