axisScrollable static method

String axisScrollable({
  1. required bool horizontal,
})

The nearest scrollable around the selected node along one axis as x,y,w,h,paged, or empty when there is none; each step up asks the scrollable's own context, so scrollables on the other axis are skipped.

Implementation

static String axisScrollable({required bool horizontal}) => '((Element e) { dynamic s = Scrollable.maybeOf(e); '
    'while (s != null && s.axisDirection.index % 2 != ${horizontal ? 1 : 0}) { s = Scrollable.maybeOf(s.context); } '
    "if (s == null) { return ''; } final b = s.context.findRenderObject() as RenderBox; final o = b.localToGlobal(Offset.zero); "
    "return o.dx.toString() + ',' + o.dy.toString() + ',' + b.size.width.toString() + ',' + b.size.height.toString() + ',' + "
    "(s.position.runtimeType.toString().contains('PagePosition') ? '1' : '0'); })"
    '($_el)';