Closed VasiiH closed 3 years ago
@VasiiH
the error most likely depends from your implementation rather than a bug with flutter
nevertheless
can you provide, together with your flutter doctor -v
a complete reproducible minimal code sample, not a snippet from production code
thank you for your support, i solve the problem
On Sun, Dec 13, 2020 at 2:03 PM Francesco Iapicca notifications@github.com wrote:
@VasiiH https://github.com/VasiiH the error most likely depends from your implementation rather than a bug with flutter nevertheless can you provide, together with your flutter doctor -v a complete reproducible minimal code sample, not a snippet from production code
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/flutter/flutter/issues/72220#issuecomment-743973657, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJT24N3RJQLT24VUN4FKEZ3SUR357ANCNFSM4UZF2WTQ .
thank you for your support, i solve the problem
@VasiiH if the problem is solved please close the issue
How did you solve can u share it with me?
Sure, i have used StatelessWidget thats why i got that error, i change to StatefullWidget then its working fine
On Sun, 13 Dec 2020, 7:02 p.m. Azor3, notifications@github.com wrote:
How did you solve can u share it with me?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/flutter/flutter/issues/72220#issuecomment-744008508, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJT24NYBYOBT3XCB6UKURL3SUS67RANCNFSM4UZF2WTQ .
I'm already using StatefullWidget but I have the same problem idk why
the error most likely depends from your implementation rather than a bug with flutter nevertheless can you provide, together with your flutter doctor -v a complete reproducible minimal code sample, not a snippet from production code
On Sun, 13 Dec 2020, 7:15 p.m. Azor3, notifications@github.com wrote:
I'm already using StatefullWidget but I have the same problem idk why
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/flutter/flutter/issues/72220#issuecomment-744010221, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJT24NYE3D5D4OFJAGDXQETSUTAORANCNFSM4UZF2WTQ .
Ok, I fixed it thanks for your time.
Great, thanks!
On Sun, 13 Dec 2020, 7:25 p.m. Azor3, notifications@github.com wrote:
Ok, I fixed it thanks for your time.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/flutter/flutter/issues/72220#issuecomment-744011429, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJT24N3O4PU4ORVZ2OGUNRTSUTBVBANCNFSM4UZF2WTQ .
Ok, I fixed it thanks for your time.
How did you fix it?
I am having the same problem with the context and I am already using a stateful widget any solution, please?
Future login()async{ var url = ("https://blest-cloud.000webhostapp.com/signup.php") ; var res = await http.post(Uri.parse(url),body: { "email":_emailController.text, "password":_passwordController.text,
});
print (res.body);
var data = jsonDecode(res.body);
if(data == "Success"){
Fluttertoast.showToast(
msg: "Login Successfully",
toastLength: Toast.LENGTH_SHORT,
gravity: ToastGravity.CENTER,
timeInSecForIosWeb: 1,
backgroundColor: Colors.red,
textColor: Colors.white,
fontSize: 16.0,
);
Navigator.push(context, MaterialPageRoute(builder:(_)=>Mainpage()));
}else{
Fluttertoast.showToast(
msg: "login denied",
toastLength: Toast.LENGTH_SHORT,
gravity: ToastGravity.CENTER,
timeInSecForIosWeb: 1,
backgroundColor: Colors.green,
textColor: Colors.white,
fontSize: 16.0
);
}
}
I am having the same problem with the context and I am already using a stateful widget any solution, please?
Future login()async{ var url = ("https://blest-cloud.000webhostapp.com/signup.php") ; var res = await http.post(Uri.parse(url),body: { "email":_emailController.text, "password":_passwordController.text,
}); print (res.body); var data = jsonDecode(res.body); if(data == "Success"){ Fluttertoast.showToast( msg: "Login Successfully", toastLength: Toast.LENGTH_SHORT, gravity: ToastGravity.CENTER, timeInSecForIosWeb: 1, backgroundColor: Colors.red, textColor: Colors.white, fontSize: 16.0, ); Navigator.push(context, MaterialPageRoute(builder:(_)=>Mainpage())); }else{ Fluttertoast.showToast( msg: "login denied", toastLength: Toast.LENGTH_SHORT, gravity: ToastGravity.CENTER, timeInSecForIosWeb: 1, backgroundColor: Colors.green, textColor: Colors.white, fontSize: 16.0 ); }
}
login(BuildContext context) async................... should solve the problem dont forget to call context whenever you use login()
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v
and a minimal reproduction of the issue.
GestureDetector( onTap: () => Navigator.push( context, // here it shows undefined name 'context' MaterialPageRoute( builder: (_) => RestaurantScreen(restaurant: restaurant), ), ),