Skip to main content

flutter-deactivate-setstate-during-build

Fix "setState() or markNeedsBuild() called during build" error triggered from deactivate(). Use when: (1) Error occurs during widget disposal or navigation away, (2) Stack trace shows deactivate -> some notifier -> ValueListenableBuilder._valueChanged, (3) Video/audio player pause() or stop() calls in deactivate() cause the error. The fix is deferring state-modifying operations to addPostFrameCallback.

Jump to install

Source facts

Repository
divinevideo/divine-mobile
Last source activity
August 7, 2026 at 14:43
Detected SKILL.md language
English
Stars
262
Forks
52

Install options

The review-first prompt is selected by default. You can switch to a direct command or download a local copy.

Review the source files

Read SKILL.md and any companion files shown by SkillsMP before deciding whether to install.