docs: Minor updates to steps 3 & 4 in Klondike tutorial #2626
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
I have just finished steps 1-4 of the Klondike tutorial and noticed a couple of minor things that look to be outdated with the current dart / flame versions.
Step 3 -
late
keyword isn't requiredWhen following this step the analyser hightlight this rule unnecessary_late (introduced in Dart 2.16.0) which states:
I updated the notes around why the laziness is important so the reader can still understand the reasoning.
Step 4 - local
_isDragging
vsDragCallbacks.isDragged
Looking through the
DragCallbacks
mixin I found thatonDragStart()
andonDragEnd()
both set a private_isDragged
flag that acts the same as the_isDragging
local flag created in the tutorial. This was added in #2472 along with@mustCallSuper
annotations on both methods.So this change brings the docs up to date by having the new
onDragStart
/onDragEnd
methods reference theirsuper
'ssuper.onDragStart
andsuper.onDragEnd
instead of the local flag, and nowonDragUpdate
,onDragEnd
useif (!isDragged) { .. }
instead ofif (!_isDragging) { .. }
.Thanks for awesome tutorial! It's really well written and explains everything just as you need it without being overwhelming.
Checklist
docs
and added dartdoc comments with///
.examples
ordocs
.Breaking Change?