-
-
Notifications
You must be signed in to change notification settings - Fork 912
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: Klondike tutorial, part 4 #1740
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good stuff!
@@ -1,7 +1,7 @@ | |||
import 'package:flame/game.dart'; | |||
import 'package:flutter/widgets.dart'; | |||
|
|||
import 'package:klondike/step3/klondike_game.dart'; | |||
import 'klondike_game.dart'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it matter when it is docs? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it matter when it is docs? 🤔
It does because it make code review easier 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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).docs
and added dartdoc comments with///
.examples
.Breaking Change
Related Issues
Closes #1678