how can i solve this? I need to get the email value.
CodePudding user response:
You can't do that! You can't affect a future to a property.
You need to first get the value and then affect it to property, like this:
void _newRegisterMethod() async {
String myValue = await _loginEmail();
Navigator.pushReplacement(
context, MaterialPageRoute(builder: (context) => FormWidget(loginEmail: myValue)));
}
Assuming that _loginEmail
is a method, not a var, because in your code you have _loginEmail.then
, guess it miss parenthesis.