RaisedButton(
color: Colors.blueAccent,
onPressed: () =>sendData(); //fun1
signupPage(context) //fun2
child:
Text("Signup"),
)
this code gives an error..Expected to find ')'
enter image description here
Arrow Function
can run single statement function.
Options:
1 - You can run two Functions as Below.
RaisedButton(
color: Colors.blueAccent,
onPressed: () {
sendData(); //fun1
signupPage(context); //fun2
},
child:
Text("Signup"),
)
Or
2 - You can run fun2 in fun 1.
RaisedButton(
color: Colors.blueAccent,
onPressed: () => sendData(context), //fun1
child:
Text("Signup"),
)
void sendData(BuildContext context){
//sendData Code ...
signupPage(context); //fun2
...
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With