Thank you for this walk through!
I noticed that there seem to be several formatting errors throughout this article that I hope you can clarify:
On your “page2.dart” template, there should be a second parenthesis to close the RaisedButton.
When you quote the single line of code “String name;” and say that it belongs to page2.dart, I think that you mean to assign it to the main.dart page, because when you say name=text in the code sample below it, name is undefined.
After fixing these issues, the only other one I encountered was that setState() in main.dart is not defined for the class. Do these need to be stateful rather than stateless widgets? If you could please post updates to this code so that it runs correctly, I would appreciate it!!