Repository: flutter
Issue: CompositedTransformFollower doesn't follow a target in a ListView
Labels: framework,has reproducible steps,P2,found in release: 3.3,found in release: 3.5,team-framework,triaged-framework

I'm using `CompositedTransformTarget` and `CompositedTransformFollower` to display a mobile selection drag handle at the bottom right corner of a selection rectangle. The selection rectangle expands and contracts as the user drags the handle. However, the drag handle doesn't follow the bottom right corner of the selection rectangle as it should.

Strangely, this problem only happens with the drag handle that's following the right side of the `CompositedTransformTarget`. The handle that's on the left side of the target moves as expected, when the user drags the upstream side.

I created a minimal reproduction of the issue:


https://user-images.githubusercontent.com/7259036/197446300-5bcc4624-17cb-4443-84fb-8c9e68ff1bf8.mov

In this video, the red square on the right should always appear at the bottom-right corner of the blue rectangle as it expands.

Source code:
```dart
import 'dart:async';

import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      title: 'Flutter follower bug',
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key});

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  final _anchor = LayerLink();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: SizedBox.expand(
        child: Stack(
          children: [
            Positioned.fill(
              child: _ExpandingBox(
                anchor: _anchor,
              ),
            ),
            CompositedTransformFollower(
              link: _anchor,
              targetAnchor: Alignment.bottomLeft,
              followerAnchor: Alignment.topRight,
              child: Container(
                width: 50,
                height: 50,
                color: Colors.red,
              ),
            ),
            CompositedTransformFollower(
              link: _anchor,
              targetAnchor: Alignment.bottomRight,
              followerAnchor: Alignment.topLeft,
              child: Container(
                width: 50,
                height: 50,
                color: Colors.red,
              ),
            ),
          ],
        ),
      ),
    );
  }
}

class _ExpandingBox extends StatefulWidget {
  const _ExpandingBox({
    Key? key,
    required this.anchor,
  }) : super(key: key);

  final LayerLink anchor;

  @override
  State<_ExpandingBox> createState() => _ExpandingBoxState();
}

class _ExpandingBoxState extends State<_ExpandingBox> {
  double _width = 0.0;

  @override
  void initState() {
    super.initState();
    Timer(const Duration(seconds: 1), _expandBox);
  }

  void _expandBox() {
    if (!mounted) {
      return;
    }

    setState(() {
      _width += 20.0;
    });

    Timer(const Duration(seconds: 1), _expandBox);
  }

  @override
  Widget build(BuildContext context) {
    return Stack(
      children: [
        ListView.builder(itemBuilder: (context, index) {
          return SizedBox(
            width: double.infinity,
            height: 2000,
            child: Stack(
              children: [
                Positioned.fromRect(
                  rect: Rect.fromLTWH(100, 100, _width, 150),
                  child: CompositedTransformTarget(
                    link: widget.anchor,
                    child: const ColoredBox(
                      color: Colors.blue,
                    ),
                  ),
                ),
              ],
            ),
          );
        }),
      ],
    );
  }
}
```

Flutter version:
```
Flutter 3.3.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 18a827f393 (4 weeks ago) • 2022-09-28 10:03:14 -0700
Engine • revision 5c984c26eb
Tools • Dart 2.18.2 • DevTools 2.15.0
```