Skip to content

Fix numberOfTaps in the example #16

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

Merged
merged 1 commit into from
Mar 13, 2024

Conversation

timbotimbo
Copy link
Collaborator

@timbotimbo timbotimbo commented Mar 12, 2024

The example contains a tap counter, that never increments as intended.

This is caused by using ++ in _numberOfTaps++.

From the docs

++var var  =  var + 1 (expression value is var + 1)
var++ var  =  var + 1 (expression value is var)

I've simply changed it to += 1 for clarity.

- _numberOfTaps = _numberOfTaps++;
+ _numberOfTaps += 1;

@jamesncl jamesncl merged commit c499c4f into learntoflutter:main Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants