disableUntilCompleted abstract method
Wraps an async action so it cannot be started twice.
Returns null while a previous invocation is still running, which most
Flutter widgets read as "disabled":
Obx((ref) => ElevatedButton(
onPressed: ref.disableUntilCompleted(actions.save),
child: const Text('Save'),
))
The returned callback rebuilds the block when the action starts and again when it completes. Pass a stable function reference — identity is what tracks the in-flight action, so an inline closure would be a new action on every build.
Implementation
Future<void> Function()? disableUntilCompleted(Future<void> Function() action);