Repository: flutter
Issue: DraggableScrollableSheet's scrollController is not in sync with inner Listview when Keyboard is in focus
Labels: framework,f: scrolling,has reproducible steps,P2,found in release: 2.8,found in release: 2.9,team-framework,triaged-framework

This happens when I open a DraggableScrollableSheet with showModalBottomSheet (and set isScrollControlled to true), add padding `MediaQuery.of(context).viewInsets.bottom` and put a scrollable widget inside the DraggableScrollableSheet. When I tap on a text field towards the bottom of the sheet, it moves up a little and gets "stuck". If I scroll down, the scrollable widget moves, but only inside the container, as if it's not using the scroll controller that the DraggableScrollableSheet has passed. On the other hand, if I scroll up to the top, it gets fixed and I can again scroll the whole sheet.

Something I noticed in the video, is that the sheet appears with initialChildSize of 0.5 and when the keyboard opens the sheet seems to keep its size at 0.5, which is now smaller in actual height, as the available space is less.

Also, I don't know if it's connected but [here is an issue](https://github.com/flutter/flutter/issues/71418#issue-753661205) that mentions showModalBottomSheet and the keyboard offset

https://user-images.githubusercontent.com/35681808/145442406-ec5fed65-7c10-42e7-a512-5fa8e3c22a63.mp4

<details>
<summary>Steps to Reproduce</summary>

```dart
import 'package:flutter/material.dart';

void main() => runApp(
      MaterialApp(
        debugShowCheckedModeBanner: false,
        home: App(),
      ),
    );

class App extends StatelessWidget {
  const App();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.yellow,
      body: Center(
        child: IconButton(
          icon: Icon(Icons.search),
          onPressed: () => showModalBottomSheet(
            context: context,
            isScrollControlled: true,
            builder: (_) => Padding(
              padding: EdgeInsets.only(
                bottom: MediaQuery.of(context).viewInsets.bottom,
              ),
              child: DraggableScrollableSheet(
                expand: false,
                builder: (_, controller) => Container(
                  color: Colors.lightBlue,
                  child: ListView.builder(
                    itemCount: 20,
                    itemExtent: 50,
                    controller: controller,
                    itemBuilder: (_, i) => TextField(
                      decoration: InputDecoration(hintText: i.toString()),
                    ),
                  ),
                ),
              ),
            ),
          ),
        ),
      ),
    );
  }
}
```
</details>

<details>
<summary>flutter doctor  -v</summary>

```
[√] Flutter (Channel stable, 2.8.0, on Microsoft Windows [Version 10.0.19043.1348], locale en-US)
    • Flutter version 2.8.0 at C:\Dev\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision cf44000065 (22 hours ago), 2021-12-08 14:06:50 -0800
    • Engine revision 40a99c5951
    • Dart version 2.15.0

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at D:\Programs\Android_SDK
    • Platform android-31, build-tools 30.0.3
    • Java binary at: D:\Programs\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    • All Android licenses accepted.

[X] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[√] Android Studio (version 4.1)
    • Android Studio at D:\Programs\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] VS Code (version 1.63.0)
    • VS Code at C:\Users\hrist\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.29.0

[√] Connected device (1 available)
    • Edge (web) • edge • web-javascript • Microsoft Edge 96.0.1054.43
```
</details>

flutter analyze: "No issues found! (ran in 1.3s)"