scrollableAround function

Future<AxisScrollable?> scrollableAround(
  1. FlutterRuntime runtime,
  2. Scene scene,
  3. SceneNode node, {
  4. required bool horizontal,
})

The nearest scrollable around node that scrolls along the horizontal or vertical axis, skipping nearer ones on the other axis; null when there is none or the eval fails.

Implementation

Future<AxisScrollable?> scrollableAround(
  FlutterRuntime runtime,
  Scene scene,
  SceneNode node, {
  required bool horizontal,
}) async {
  final groupName = (node.glintId != null && scene.isInOverlay(node.glintId!))
      ? (scene.fullGroupName ?? scene.groupName)
      : scene.groupName;
  final raw = await runtime.evaluateWithSelection(
    expression: GeometryExpr.axisScrollable(horizontal: horizontal),
    inspectorId: node.inspectorId,
    groupName: groupName,
  );
  final parts = raw?.split(',').map(double.tryParse).toList();
  if (parts == null || parts.length != 5 || parts.contains(null)) return null;
  return (rect: (x: parts[0]!, y: parts[1]!, w: parts[2]!, h: parts[3]!), paged: parts[4] == 1);
}