Skip to content

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