ITADN

Error when adding AppBar, tutorial code suddenly not matching previous step.

#13431OpenSidewinder1138 创建于 2026-05-27
from.page-issue
S
Sidewinder1138commented
### Page URL https://docs.flutter.dev/learn/pathway/tutorial/layout ### Page source https://github.com/flutter/website/blob/main/sites/docs/src/content/learn/pathway/tutorial/layout.md ### Describe the problem In the previous step of this tutorial (3) we added a little Tile StatelessWidget. There was also no existing AppBar. In this step, suddenly we are back to "Hello World". Also, when I go to add the AppBar, I get an error about "The constructor being called isn't a const constructor." This is pretty jarring/confusing for beginners. Probably an easy fix, but I don't know enough to contribute yet. ### Expected fix As you go through the steps of the tutorial, things shouldn't suddenly change on you! If this is a common "gotcha" regarding const, please add a box explaining how to resolve it. ### Additional context _No response_ ### I would like to fix this problem. - [ ] I will try and fix this problem on docs.flutter.dev.
1 条评论