docs: Klondike tutorial, part 4#1740
Conversation
| import 'package:flutter/widgets.dart'; | ||
|
|
||
| import 'package:klondike/step3/klondike_game.dart'; | ||
| import 'klondike_game.dart'; |
There was a problem hiding this comment.
IMO, such change should be done on a different PR, this is a lint refactor that has nothing to do with the new step right?
There was a problem hiding this comment.
Does it matter when it is docs? 🤔
There was a problem hiding this comment.
It actually has something to do with the new step:
We want each step to be completely independent from all other steps, so that the user can look at the code of that step, and even copy that code, without having to do any adjustments. The relative imports allow to do just that: they hide the fact that this file is part of a "step3" (since there wouldn't be any steps in user's code as they try to follow the tutorial).
Without this change it's possible to accidentally import classes from wrong steps (esp. if relying on IDE to do auto-import for you), and then you'd be wondering why the changes that you make to some class have no effect...
There was a problem hiding this comment.
Does it matter when it is docs? 🤔
It does because it make code review easier 😉
There was a problem hiding this comment.
Without this change it's possible to accidentally import classes from wrong steps (esp. if relying on IDE to do auto-import for you), and then you'd be wondering why the changes that you make to some class have no effect...
got it, but still, once this was identified, you could have extracted into a separate PR. Either way no need to change now, but just something to think for future PRs.
erickzanardo
left a comment
There was a problem hiding this comment.
Overall LGTM, nice job on this step, left just a couple of comments.
Description
This PR adds step 4 for the Klondike tutorial: "Gameplay".
Checklist
fix:,feat:,docs:etc).docsand added dartdoc comments with///.examples.Breaking Change
Related Issues
Closes #1678