How to Check Ref.mounted After an Async Gap in Flutter Riverpod 3
In a Notifier, resolve dependencies before the await, then guard the state write with if (!ref.mounted) return. This is the Riverpod 3.0 replacement for the old onDispose mixin, and it stops UnmountedRefException when a provider is disposed mid-await. Tested on flutter_riverpod 3.x, Flutter 3.44, Dart 3.x.