Repository: flutter
Issue: [two_dimensional_scrollables] TableView doesn't restore to the correct offset
Labels: f: scrolling,has reproducible steps,P2,team-framework,triaged-framework,found in release: 3.22,found in release: 3.23

### What package does this bug report belong to?

two_dimensional_scrollables

### What target platforms are you seeing this bug on?

iOS

### Have you already upgraded your packages?

Yes

### Dependency versions

_No response_

### Steps to reproduce

1. Create a TableView.builder, larger than the screen size
2. Use a PageStorageKey as the key parameter
3. Scroll to a random position
4. Remove the TableView from the ViewTree (using a button)
5. Add the TableView back to the ViewTree (using a button)

### Expected results

The TableView should have the same vertical and horizontal offset as before.

### Actual results

The TableView has a different offset as before.

### Code sample

<details open><summary>Code sample</summary>

```dart
import 'package:flutter/material.dart';
import 'package:two_dimensional_scrollables/two_dimensional_scrollables.dart';

class TableExample extends StatefulWidget {
  const TableExample({super.key});

  @override
  State<TableExample> createState() => _TableExampleState();
}

class _TableExampleState extends State<TableExample> {
  bool _isVisible = true;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: _isVisible
          ? TableView.builder(
              key: const PageStorageKey('table_view'),
              cellBuilder: _buildCell,
              columnCount: 50,
              columnBuilder: _buildColumnSpan,
              rowCount: 100,
              rowBuilder: _buildRowSpan,
            )
          : const Text('TableView is not visible'),
      persistentFooterButtons: <Widget>[
        TextButton(
          onPressed: () => setState(() {
            _isVisible = !_isVisible;
          }),
          child: const Text('Toggle visibility'),
        ),
      ],
    );
  }

  TableViewCell _buildCell(BuildContext context, TableVicinity vicinity) {
    return TableViewCell(
      child: Center(
        child: Text('Tile c: ${vicinity.column}, r: ${vicinity.row}'),
      ),
    );
  }

  TableSpan _buildColumnSpan(int index) => const TableSpan(
        extent: FixedTableSpanExtent(150),
      );

  TableSpan _buildRowSpan(int index) => TableSpan(
        backgroundDecoration: TableSpanDecoration(
          color: index.isEven ? Colors.purple[100] : null,
        ),
        extent: const FixedTableSpanExtent(150),
      );
}

```

</details>


### Screenshots or Videos

<details open>
<summary>Screenshots / Video demonstration</summary>


https://github.com/flutter/flutter/assets/1583346/a6c174a8-c3b1-45c3-99a9-56ad9bc93943



</details>


### Logs

_No response_

### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
[✓] Flutter (Channel stable, 3.22.1, on macOS 14.5 23F79 darwin-arm64 (Rosetta), locale en-NL)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.1)
[✓] IntelliJ IDEA Community Edition (version 2021.1.3)
[✓] VS Code (version 1.89.1)
[✓] Connected device (6 available)
[✓] Network resources
```

</details>