useSnapshotController function
Creates and disposes aSnapshotController.
Note thatallowSnapshotting must be set totruein order for this controller to actually do anything.This is consistent withSnapshotController.new.
IfallowSnapshotting changes on subsequent calls touseSnapshotController,SnapshotController.allowSnapshotting will be called to update accordingly.
final controller = useSnapshotController(allowSnapshotting: true);// is equivalent tofinal controller = useSnapshotController();controller.allowSnapshotting = true;See also:
Implementation
SnapshotController useSnapshotController({ bool allowSnapshotting = false,}) { return use( _SnapshotControllerHook( allowSnapshotting: allowSnapshotting, ), );}