Repository: flutter
Issue: viewport.dart: Failed assertion: 'correctedOffset.isFinite': is not true.`
Labels: c: crash,framework,f: scrolling,has reproducible steps,P2,found in release: 3.3,found in release: 3.7,team-framework,triaged-framework

## Steps to Reproduce

1. Run `flutter create bug`.
2. Replace main.dart with [this one](https://gist.github.com/afitz0/dd59f55b85e28900727b145d23de526a).
3. Run app, click FAB.

**Expected results:** List scrolls to the bottom.

**Actual results:** `'package:flutter/src/rendering/viewport.dart': Failed assertion: line 1328 pos 12: 'correctedOffset.isFinite': is not true.` (see logs below). 

The intent behind this project is to have a variable-length list that scrolls to the bottom on user action. In this case, I have it just a flat list in a State, but the same effect happens if it's in a Provider or backed by some thing else.

In this case, the fix is simple: I just forgot to add `itemCount` to the ListView.builder (and then not return nulls in `itemBuilder`). But the assertion message told me to come here if the message didn't give me enough information. It didn't, and so I'm here. :)

<details>
  <summary>Logs</summary>

<!-- Relevant logs: -->
```
[        ] flutter: The following assertion was thrown during performLayout():
[        ] flutter: 'package:flutter/src/rendering/viewport.dart': Failed assertion: line 1328 pos 12:
[        ] flutter: 'correctedOffset.isFinite': is not true.
[        ] flutter:
[        ] flutter: Either the assertion indicates an error in the framework itself, or we should provide substantially
[        ] flutter: more information in this error message to help you determine and fix the underlying cause.
[        ] flutter: In either case, please report this assertion by filing a bug on GitHub:
[        ] flutter:   https://github.com/flutter/flutter/issues/new?template=BUG.md
[        ] flutter:
[        ] flutter: The relevant error-causing widget was:
[        ] flutter:   ListView file:///Users/afitzgibbon/src/listview_assert_message/lib/main.dart:38:25
[        ] flutter:
[        ] flutter: When the exception was thrown, this was the stack:
[        ] flutter: #2      RenderViewport._attemptLayout (package:flutter/src/rendering/viewport.dart:1328:12)
[        ] flutter: #3      RenderViewport.performLayout (package:flutter/src/rendering/viewport.dart:1285:20)
[        ] flutter: #4      RenderObject._layoutWithoutResize (package:flutter/src/rendering/object.dart:1584:7)
[        ] flutter: #5      PipelineOwner.flushLayout (package:flutter/src/rendering/object.dart:844:18)
[        ] flutter: #6      RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:344:19)
[        ] flutter: #7      WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:774:13)
[        ] flutter: #8      RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:283:5)
[        ] flutter: #9      SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1102:15)
[        ] flutter: #10     SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1041:9)
[        ] flutter: #11     SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:957:5)
[        ] flutter: #15     _invoke (dart:ui/hooks.dart:259:10)
[        ] flutter: #16     _drawFrame (dart:ui/hooks.dart:217:3)
[        ] flutter: (elided 5 frames from class _AssertionError and package dart:async)
[        ] flutter:
[        ] flutter: The following RenderObject was being processed when the exception was fired: RenderViewport#c3726 NEEDS-LAYOUT:
[        ] flutter:   needs compositing
[        ] flutter:   creator: Viewport ← IgnorePointer-[GlobalKey#b068f] ← Semantics ← _PointerListener ← Listener ←
[        ] flutter:     _GestureSemantics ← RawGestureDetector-[LabeledGlobalKey<RawGestureDetectorState>#7cb99] ←
[        ] flutter:     _PointerListener ← Listener ← _ScrollableScope ← _ScrollSemantics-[GlobalKey#5e317] ← Scrollable ←
[        ] flutter:     ⋯
[        ] flutter:   parentData: <none> (can use size)
[        ] flutter:   constraints: BoxConstraints(0.0<=w<=414.0, h=190.0)
[        ] flutter:   layer: OffsetLayer#575ad
[        ] flutter:   size: Size(414.0, 190.0)
[        ] flutter:   axisDirection: down
[        ] flutter:   crossAxisDirection: right
[        ] flutter:   offset: ScrollPositionWithSingleContext#4b46e(offset: Infinity, range: 0.0..Infinity, viewport:
[        ] flutter:     190.0, ScrollableState, BouncingScrollPhysics,
[        ] flutter:     DrivenScrollActivity#b1d19(AnimationController#79221(▶ Infinity; for DrivenScrollActivity)),
[        ] flutter:     ScrollDirection.idle)
[        ] flutter:   anchor: 0.0
[        ] flutter: This RenderObject had the following descendants (showing up to depth 5):
[        ] flutter:     center child: RenderSliverPadding#08004 relayoutBoundary=up1
[        ] flutter:       child: RenderSliverList#4c280 relayoutBoundary=up2
[        ] flutter:         child with index 0: RenderIndexedSemantics#695a2 relayoutBoundary=up3
[        ] flutter:           child: RenderRepaintBoundary#4d078 relayoutBoundary=up4
[        ] flutter:             child: RenderParagraph#3674b relayoutBoundary=up5
[        ] flutter:         child with index 1: RenderIndexedSemantics#ae028 relayoutBoundary=up3
[        ] flutter:           child: RenderRepaintBoundary#62ee4 relayoutBoundary=up4
[        ] flutter:             child: RenderParagraph#b8b29 relayoutBoundary=up5
[        ] flutter:         child with index 2: RenderIndexedSemantics#f17c3 relayoutBoundary=up3
[        ] flutter:           child: RenderRepaintBoundary#1d082 relayoutBoundary=up4
[        ] flutter:             child: RenderParagraph#1da1a relayoutBoundary=up5
[        ] flutter:         child with index 3: RenderIndexedSemantics#9ffce relayoutBoundary=up3
[        ] flutter:           child: RenderRepaintBoundary#43fca relayoutBoundary=up4
[        ] flutter:             child: RenderParagraph#d5625 relayoutBoundary=up5
[        ] flutter:         child with index 4: RenderIndexedSemantics#832de relayoutBoundary=up3
[        ] flutter:           child: RenderRepaintBoundary#68af9 relayoutBoundary=up4
[        ] flutter:             child: RenderParagraph#0d604 relayoutBoundary=up5
[        ] flutter:         child with index 5: RenderIndexedSemantics#32ee6 relayoutBoundary=up3
[        ] flutter:           child: RenderRepaintBoundary#5e153 relayoutBoundary=up4
[        ] flutter:             child: RenderParagraph#29a3a relayoutBoundary=up5
[        ] flutter:         child with index 6: RenderIndexedSemantics#200b1 relayoutBoundary=up3
[        ] flutter:           child: RenderRepaintBoundary#24b27 relayoutBoundary=up4
[        ] flutter:             child: RenderParagraph#90878 relayoutBoundary=up5
[        ] flutter:         child with index 7: RenderIndexedSemantics#ba6f1 relayoutBoundary=up3
[        ] flutter:           child: RenderRepaintBoundary#f7f23 relayoutBoundary=up4
[        ] flutter:             child: RenderParagraph#e16e6 relayoutBoundary=up5
[        ] flutter:         child with index 8: RenderIndexedSemantics#d6b62 relayoutBoundary=up3
[        ] flutter:           child: RenderRepaintBoundary#396d0 relayoutBoundary=up4
[        ] flutter:             child: RenderParagraph#15710 relayoutBoundary=up5
[        ] flutter: ════════════════════════════════════════════════════════════════════════════════════════════════════
[+14714 ms] Application finished.
```

<!-- `flutter analyze` -->
```
Analyzing listview_assert_message...
No issues found! (ran in 1.9s)
```

<!-- `flutter doctor -v` -->
```
[✓] Flutter (Channel stable, v1.12.13+hotfix.8, on Mac OS X 10.15.3 19D76, locale en-US)
    • Flutter version 1.12.13+hotfix.8 at /Users/afitzgibbon/src/flutter
    • Framework revision 0b8abb4724 (5 weeks ago), 2020-02-11 11:44:36 -0800
    • Engine revision e1e6ced81d
    • Dart version 2.7.0

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.0-rc2)
    • Android SDK at /Users/afitzgibbon/Library/Android/sdk/
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.0-rc2
    • ANDROID_HOME = /Users/afitzgibbon/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_212-release-1586-b4-5784211)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.3.1, Build version 11C504
    • CocoaPods version 1.7.3

[✓] Android Studio (version 3.6)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 44.0.2
    • Dart plugin version 192.7761
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)

[!] IntelliJ IDEA Community Edition (version 2019.3.3)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • For information about installing plugins, see
      https://flutter.dev/intellij-setup/#installing-the-plugins

[✓] VS Code (version 1.43.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.8.1

[✓] Connected device (1 available)
    • iPhone 11 Pro Max • 23878026-01DB-4EC7-A906-4034C3995D3E • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-3 (simulator)

! Doctor found issues in 1 category.
```

</details>