I am trying to write an if/else statement in dart on my flutter app. I am trying to see if the passed id is equal to 3 to return a whole page of code, and else would be a different page. for example...
Widget build(BuildContext context) {
final TextEditingController controller = new TextEditingController();
String result = "";
If (${widget.id} = 3){
return Scaffold(
all of scaffold 1)
}; else {
return Scaffold(
all of scaffold 2)
};
Do i need to set ${widget.id} to a variable to call into the if statement? And where would i set it in the .dart page, in void initstate(){}?