Repository: flutter
Issue: A method stick to reference the initial value of a field
Labels: c: new feature,framework,f: scrolling,c: proposal,P3,team-framework,triaged-framework

<!-- Thank you for using Flutter!

     If you are looking for support, please check out our documentation
     or consider asking a question on Stack Overflow:
      * https://flutter.dev/
      * https://api.flutter.dev/
      * https://stackoverflow.com/questions/tagged/flutter?sort=frequent

     If you have found a bug or if our documentation doesn't have an answer
     to what you're looking for, then fill out the template below. Please read
     our guide to filing a bug first: https://flutter.dev/docs/resources/bug-reports
-->

## Steps to Reproduce

<!-- You must include full steps to reproduce so that we can reproduce the problem. -->


1. [Run the sample at DartPad](https://dartpad.dev/b6409e10de32b280b8938aa75364fa7b) or run `flutter create bug` and execute with the following code.  
Scroll the list in the screen and check the output in Console.
```dart
import 'dart:async';

import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(
          title: 'issue of optimization: a method stick to '
              'reference the initial value of a field'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  double _newValue = 0;
  Timer _timer;

  @override
  void initState() {
    super.initState();
    _timer = Timer.periodic(
      const Duration(seconds: 1),
      (_) => setState(() => _newValue += 1),
    );
  }

  @override
  void dispose() {
    _timer?.cancel();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisSize: MainAxisSize.min,
          children: [
            const Text(
              'Open [Console] and try scroll the list below\n'
              'and check the value of [newValue]',
              textAlign: TextAlign.center,
            ),
            SizedBox(
              width: 100,
              height: 200,
              child: ListView.builder(
                physics: AlwaysScrollableScrollPhysics(
                  parent: MyPhysics(newValue: _newValue),
                ),
                itemBuilder: (context, index) =>
                    ListTile(title: Text('item $index')),
                itemCount: 10,
              ),
            ),
          ],
        ),
      ),
    );
  }
}

class MyPhysics extends BouncingScrollPhysics {
  MyPhysics({ScrollPhysics parent, this.newValue}) : super(parent: parent) {
    print('newValue @constructor: $newValue');
  }

  final double newValue;

  @override
  BouncingScrollPhysics applyTo(ScrollPhysics ancestor) {
    return MyPhysics(parent: buildParent(ancestor), newValue: newValue);
  }

  @override
  double applyBoundaryConditions(ScrollMetrics position, double value) {
    print('newValue @applyBoundaryConditions: $newValue');
    return 0;
  }
}
```
3. 

**Expected results:** <!-- what did you want to see? -->

In the output `newValue @applyBoundaryConditions: nnn`, `nnn` should follow as the value changes.

**Actual results:** <!-- what did you see? -->

The output kept to show `newValue @applyBoundaryConditions: 0`.

```
newValue @constructor: 0
newValue @applyBoundaryConditions: 0
newValue @constructor: 1
newValue @applyBoundaryConditions: 0
newValue @constructor: 2
newValue @constructor: 3
newValue @applyBoundaryConditions: 0
newValue @applyBoundaryConditions: 0
```

<details>
  <summary>Logs</summary>

<!--
     Run `flutter analyze` and attach any output of that command below.
     If there are any analysis errors, try resolving them before filing this issue.
-->

```
Analyzing bug...                                                        
No issues found! (ran in 2.8s)
```

<!-- Finally, paste the output of running `flutter doctor -v` here. -->

```
[✓] Flutter (Channel stable, 1.22.4, on Mac OS X 10.15.7 19H2 darwin-x64, locale ja-JP)
    • Flutter version 1.22.4 at /Users/tohru/Documents/src/flutter
    • Framework revision 1aafb3a8b9 (8 weeks ago), 2020-11-13 09:59:28 -0800
    • Engine revision 2c956a31c0
    • Dart version 2.10.4

 
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at /Users/tohru/Library/Android/sdk
    • Platform android-30, build-tools 30.0.2
    • ANDROID_HOME = /Users/tohru/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.2, Build version 12B45b
    • CocoaPods version 1.10.0

[✓] Android Studio (version 4.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 43.0.1
    • Dart plugin version 191.8593
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] IntelliJ IDEA Ultimate Edition (version 2020.3)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin installed
    • Dart plugin version 203.6912

[!] VS Code (version 1.29.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    ✗ Flutter extension not installed; install from
      https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
```

</details>