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
Page: https://docs.flutter.dev/learn/pathway/tutorial/layout — Step 4 ("Arrange widgets with Column and Row")
Description
In the challenge box at the end of step 4, the following statement appears:
"Add a Tile to each row for each letter allowed in the guess. The guess variable in the loop is a record with the type ({String char, HitType type})."
This is misleading. The outer loop variable guess iterates over _game.guesses, which is a list of lists — so guess is itself a list of ({String char, HitType type}) records, not a single record.
The variable that actually has the type ({String char, HitType type}) is letter in the inner loop, as shown in the solution:
for (var letter in guess) Tile(letter.char, letter.type)
A reader following the description literally would reasonably write Tile(guess.char, guess.type) — which does not compile, since guess has no .char or .type fields.
Steps to reproduce
- Read the challenge description in step 4.
- Attempt the challenge based solely on the description.
- Write
Tile(guess.char, guess.type) as the text implies.
- Observe a compile error — the solution requires a nested loop not mentioned in the description.
Expected fix
Replace the sentence with something like:
"Each element of guess is a record with the type ({String char, HitType type}). Use a nested loop to iterate over the letters in each guess."
Additional context
No response
I would like to fix this problem.
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
Page: https://docs.flutter.dev/learn/pathway/tutorial/layout — Step 4 ("Arrange widgets with Column and Row")
Description
In the challenge box at the end of step 4, the following statement appears:
This is misleading. The outer loop variable
guessiterates over_game.guesses, which is a list of lists — soguessis itself a list of({String char, HitType type})records, not a single record.The variable that actually has the type
({String char, HitType type})isletterin the inner loop, as shown in the solution:A reader following the description literally would reasonably write
Tile(guess.char, guess.type)— which does not compile, sinceguesshas no.charor.typefields.Steps to reproduce
Tile(guess.char, guess.type)as the text implies.Expected fix
Replace the sentence with something like:
Additional context
No response
I would like to fix this problem.