Skip to main content

riverpod-ref-read-in-dispose

Fix Riverpod "Using ref when widget is unmounted is unsafe" error in ConsumerStatefulWidget. Use when: (1) Error thrown in dispose() when calling ref.read(), (2) Need to call a service method during widget cleanup, (3) ConsumerStatefulWidget needs to perform actions on provider when user navigates away. Solution: cache the service/notifier in initState with late final.

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.