Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extreme bounce to top at end of GridView and ListView #11071

Closed
perlatus opened this issue Jul 2, 2017 · 7 comments
Closed

Extreme bounce to top at end of GridView and ListView #11071

perlatus opened this issue Jul 2, 2017 · 7 comments
Labels
f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels.

Comments

@perlatus
Copy link
Contributor

perlatus commented Jul 2, 2017

Bug demo video: https://blog.vczf.io/vid/overscroll-bounce.mp4

Potentially related to #7477? Tried increasing the window size to 150 but it didn't fix it.


Steps to Reproduce

Cloneable repo here, code also pasted below.

ListView

import 'package:flutter/material.dart';

const _style = const TextStyle(fontWeight: FontWeight.bold, fontSize: 36.0);

Widget _buildCard(BuildContext ctx, int i) {
  if (i > 15) {
    return null;
  } else if (i == 15) {
    return new Card(child: new Container(color: Colors.red));
  } else if (i == 0) {
    return new Card(child: new Container(color: Colors.green));
  }

  Widget text = new Text(i.toString(), style: _style);
  return new Card(child: new Center(child: text));
}

void main() {
  runApp(
    new MaterialApp(
      home: new Scaffold(
        body: new ListView.builder(itemExtent: 400.0, itemBuilder: _buildCard),
      ),
    ),
  );
}

GridView

import 'package:flutter/material.dart';

const _style = const TextStyle(fontWeight: FontWeight.bold, fontSize: 36.0);

Widget _buildCard(BuildContext ctx, int i) {
  if (i > 50) {
    return null;
  } else if (i == 50) {
    return new Card(child: new Container(color: Colors.red));
  } else if (i == 0) {
    return new Card(child: new Container(color: Colors.green));
  }

  Widget text = new Text(i.toString(), style: _style);
  return new Card(child: new Center(child: text));
}

void main() {
  runApp(new MaterialApp(
    home: new Scaffold(
      body: new GridView.custom(
        gridDelegate: new SliverGridDelegateWithMaxCrossAxisExtent(
            maxCrossAxisExtent: 150.0, childAspectRatio: 3 / 5),
        childrenDelegate: new SliverChildBuilderDelegate(_buildCard),
      ),
    ),
  ));
}

Logs

Nothing interesting in the logs...

(( 00:26:12 )) ~/.../gh/overscroll_bounce
» % flutter run
Launching lib/main.dart on SCH I535 in debug mode...
Initializing Gradle...                                0.9s
Resolving dependencies...                             0.8s
Running 'gradlew assembleDebug'...                   16.9s
Built build/app/outputs/apk/app-debug.apk (21.5MB).
Installing build/app/outputs/apk/app.apk...           8.8s
Syncing files to device SCH I535...                   7.4s

🔥  To hot reload your app on the fly, press "r". To restart the app entirely, press "R".
An Observatory debugger and profiler on SCH I535 is available at: http://127.0.0.1:8118/
For a more detailed help message, press "h". To quit, press "q".
(( 00:27:39 )) ~/.../gh/overscroll_bounce
» % flutter analyze
Analyzing (( snip ))gh/overscroll_bounce...
No issues found!
Ran in 5.5s

Flutter Doctor

(( 00:27:47 )) ~/.../gh/overscroll_bounce
» % flutter doctor
[✓] Flutter (on Linux, locale en_US.UTF-8, channel master)
    • Flutter at (( snip ))flutter
    • Framework revision 7ba1879bfc (7 hours ago), 2017-07-01 14:16:36 -0700
    • Engine revision 8ad1576f27
    • Tools Dart version 1.24.2

[✓] Android toolchain - develop for Android devices (Android SDK 25.0.3)
    • Android SDK at (( snip ))android-sdk
    • Platform android-25, build-tools 25.0.3
    • ANDROID_HOME = (( snip ))opt/android-sdk
    • Java binary at: (( snip ))opt/android-studio-dev/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_112-release-b736)

[✓] Android Studio (version 2.3)
    • Android Studio at (( snip ))android-studio
    • Java version OpenJDK Runtime Environment (build 1.8.0_112-release-b06)

[✓] Android Studio (version 2.4)
    • Android Studio at (( snip ))android-studio-dev
    • Java version OpenJDK Runtime Environment (build 1.8.0_112-release-b736)

[✓] Android Studio
    • Android Studio at /opt/android-studio
    • Java version OpenJDK Runtime Environment (build 1.8.0_112-release-b06)

[-] IntelliJ IDEA Community Edition (version 2017.1)
    ✗ Flutter plugin version 13.0 - the recommended minimum version is 14.0.0
    • Dart plugin version 171.4424
    • For information about installing plugins, see
      https://flutter.io/intellij-setup/#installing-the-plugins

[✓] Connected devices
    • SCH I535 • 14495d54 • android-arm • Android 4.4.2 (API 19)
@perlatus
Copy link
Contributor Author

I haven't added it to the example repo, but I'm also seeing the bouncing on PageView.

@Hixie Hixie added f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels. labels Aug 30, 2017
@perlatus
Copy link
Contributor Author

So now instead of bouncing, it just keeps on scrolling.

I/flutter ( 5576): ══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════
I/flutter ( 5576): The following NoSuchMethodError was thrown during performLayout():
I/flutter ( 5576): The method '*' was called on null.
I/flutter ( 5576): Receiver: null
I/flutter ( 5576): Tried calling: *(400.0)
I/flutter ( 5576): When the exception was thrown, this was the stack:
I/flutter ( 5576): #0      Object.noSuchMethod (dart:core/runtime/libobject_patch.dart:46:5)
I/flutter ( 5576): #1      RenderSliverFixedExtentBoxAdaptor.computeMaxScrollOffset (package:flutter/src/rendering/sliver_fixed_extent_list.dart:133:36)
I/flutter ( 5576): #2      RenderSliverFixedExtentBoxAdaptor.performLayout (package:flutter/src/rendering/sliver_fixed_extent_list.dart:171:28)
I/flutter ( 5576): #3      RenderObject.layout (package:flutter/src/rendering/object.dart:1570:7)
I/flutter ( 5576): #4      RenderSliverPadding.performLayout (package:flutter/src/rendering/sliver_padding.dart:182:11)
I/flutter ( 5576): #5      RenderObject.layout (package:flutter/src/rendering/object.dart:1570:7)
I/flutter ( 5576): #6      RenderViewportBase.layoutChildSequence (package:flutter/src/rendering/viewport.dart:285:13)
I/flutter ( 5576): #7      RenderViewport._attemptLayout (package:flutter/src/rendering/viewport.dart:1008:12)
I/flutter ( 5576): #8      RenderViewport.performLayout (package:flutter/src/rendering/viewport.dart:932:20)
I/flutter ( 5576): #9      RenderObject._layoutWithoutResize (package:flutter/src/rendering/object.dart:1445:7)
I/flutter ( 5576): #10     PipelineOwner.flushLayout (package:flutter/src/rendering/object.dart:709:18)
I/flutter ( 5576): #11     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:270:19)
I/flutter ( 5576): #12     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&RendererBinding&WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:622:13)
I/flutter ( 5576): #13     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:208:5)
I/flutter ( 5576): #14     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:990:15)
I/flutter ( 5576): #15     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:930:9)
I/flutter ( 5576): #16     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:842:5)
I/flutter ( 5576): #17     _invoke (dart:ui/hooks.dart:120:13)
I/flutter ( 5576): #18     _drawFrame (dart:ui/hooks.dart:109:3)
I/flutter ( 5576): The following RenderObject was being processed when the exception was fired:
I/flutter ( 5576):   RenderSliverFixedExtentList#30205 relayoutBoundary=up2 NEEDS-LAYOUT
I/flutter ( 5576):   creator: SliverFixedExtentList ← MediaQuery ← SliverPadding ← Viewport ← _ScrollableScope ←
I/flutter ( 5576):   IgnorePointer-[GlobalKey#afb22] ← Semantics ← Listener ← _GestureSemantics ←
I/flutter ( 5576):   RawGestureDetector-[LabeledGlobalKey<RawGestureDetectorState>#7618f] ←
I/flutter ( 5576):   _ExcludableScrollSemantics-[GlobalKey#453eb] ← RepaintBoundary ← ⋯
I/flutter ( 5576):   parentData: paintOffset=Offset(0.0, 0.0) (can use size)
I/flutter ( 5576):   constraints: SliverConstraints(AxisDirection.down, GrowthDirection.forward,
I/flutter ( 5576):   ScrollDirection.reverse, scrollOffset: 6406.6, remainingPaintExtent: 533.3, crossAxisExtent:
I/flutter ( 5576):   320.0, crossAxisDirection: AxisDirection.right, viewportMainAxisExtent: 533.3)
I/flutter ( 5576):   geometry: SliverGeometry(scrollExtent: Infinity, paintExtent: 45.8, maxPaintExtent: Infinity,
I/flutter ( 5576):   hasVisualOverflow: true)
I/flutter ( 5576):   no children current live
I/flutter ( 5576): This RenderObject has no descendants.
I/flutter ( 5576): ════════════════════════════════════════════════════════════════════════════════════════════════════

@zoechi
Copy link
Contributor

zoechi commented Jan 16, 2019

The error

The method '*' was called on null.

still reproduces (only tried the ListView example above.

@zoechi zoechi added this to the Goals milestone Jan 16, 2019
@passsy
Copy link
Contributor

passsy commented Mar 3, 2020

Can't reproduce this anymore Flutter 1.15.4-pre.219

@VladyslavBondarenko
Copy link

@perlatus can the issue be closed?

@VladyslavBondarenko VladyslavBondarenko added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Mar 23, 2020
@perlatus
Copy link
Contributor Author

Sure

@no-response no-response bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Mar 23, 2020
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels.
Projects
Scrolling Refactor
Awaiting triage
Development

No branches or pull requests

5 participants