Skip to content

State not reflected when there is no user input #23

Closed
@dluksza

Description

@dluksza

When setState is called from code instead of on user action (like mouse click or screen tap), first execution is not reflected in the UI.

Here is counter project modified to automatically increment counter value every 2s: https://github.com/dluksza/flutter_auto_refresh

On android emulator everything works fine UI shows 0, 1, 2, 3, 4, 5 etc. every 2s. But when the same code is run using flutter-pi on Rpi3 it shows 0, 2, 4, 6 etc every 4s. whereas on console values 1, 2, 3, 4 etc. are printed every 2s.

This also means that other automatic UI updates will not be reflected until another setState is called.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions