getScrollOffset method

double? getScrollOffset(
  1. String key
)

Gets the current scroll offset of the controller with the given key.

Returns null if no controller exists or if it's not attached.

Implementation

double? getScrollOffset(String key) {
  final controller = _controllers[key];
  if (controller == null || !controller.hasClients) return null;
  return controller.offset;
}