Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: preserve visible state in state consumer#11

Open
Des1ynY wants to merge 1 commit intoPlugFox:master from
Des1ynY:master
Open

fix: preserve visible state in state consumer #11
Des1ynY wants to merge 1 commit intoPlugFox:master from
Des1ynY:master

Conversation

@Des1ynY
Copy link

@Des1ynY Des1ynY commented Feb 13, 2026

Bug description: StateConsumer dropped visible state when rebuilding from outer scope.

Why happened: StateConsumer utilized _controller.state property. buildWhen method prevents rebuilding widget internally, so when StateConsumer is isolated everything works well and visible state is preserved. But any rebuild from outer scope (setState, ListenableBuilder, etc.) that will trigger StateConsumer rebuild, will cause visible state loss in favor of current controller state.

Fix: cache visible state in _StateConsumerState and use it in builder

IDK if it was by design but caused some troubles in our project. Highly appreciate your work, we're migrating from bloc to control and it's doing great job. Thank you)

@Des1ynY Des1ynY changed the title (削除) fix: reserve visible state in state consumer (削除ここまで) (追記) fix: preserve visible state in state consumer (追記ここまで) Feb 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /