Passing Data to a Stateful Widget

Posted by Jennifer | Updated on | Dart

Passing Data to a Stateful Widget. Don’t pass parameters to State using it’s constructor. You should only access these using this.widget.myField.

Not only editing the constructor requires a lot of manual work ; it doesn’t bring anything. There’s no reason to duplicate all the fields of Widget.


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers