-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Closed
Copy link
Labels
in triagePresently being triaged by the triage teamPresently being triaged by the triage team
Description
Steps to Reproduce
This is the Issue:
After Upgrading the flutter to the latest version. I'm facing this issue, I've the same code for another application having earlier version of flutter and it is working fine.
What it does with my list view is that:
With the new ListView add two or more children.
Scroll down the list to the point where the first child is entirely off the screen.
Make any changes to the contents, so that the first child reduces its height.
Scroll all the way back up to the initial position. The ListView shows nothing on screen (just white empty space).
Logs
Another exception was thrown: 'package:flutter/src/rendering/sliver.dart': Failed assertion: line 556 pos 15: 'scrollOffsetCorrection != 0.0': is not true.
Another exception was thrown: NoSuchMethodError: The method '-' was called on null.
Another exception was thrown: 'package:flutter/src/rendering/sliver.dart': Failed assertion: line 556 pos 15: 'scrollOffsetCorrection != 0.0': is not true.
Another exception was thrown: NoSuchMethodError: The method '-' was called on null.
════════ Exception caught by rendering library ═════════════════════════════════════════════════════
The following assertion was thrown during performLayout():
'package:flutter/src/rendering/sliver.dart': Failed assertion: line 556 pos 15: 'scrollOffsetCorrection != 0.0': is not true.
Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
https://github.com/flutter/flutter/issues/new?template=BUG.md
The relevant error-causing widget was:
ListView file:///G:/Abc/abc/lib/HomeScreen/HomeScreenDemo.dart:787:34
When the exception was thrown, this was the stack:
#2 new SliverGeometry (package:flutter/src/rendering/sliver.dart:556:15)
#3 RenderSliverList.performLayout (package:flutter/src/rendering/sliver_list.dart:180:20)
#4 RenderObject.layout (package:flutter/src/rendering/object.dart:1769:7)
#5 RenderSliverEdgeInsetsPadding.performLayout (package:flutter/src/rendering/sliver_padding.dart:137:11)
#6 RenderSliverPadding.performLayout (package:flutter/src/rendering/sliver_padding.dart:377:11)
...
The following RenderObject was being processed when the exception was fired: RenderSliverList#07b82 relayoutBoundary=up33 NEEDS-LAYOUT NEEDS-COMPOSITING-BITS-UPDATE
... needs compositing
... parentData: paintOffset=Offset(0.0, 0.0) (can use size)
... constraints: SliverConstraints(AxisDirection.right, GrowthDirection.forward, ScrollDirection.forward, scrollOffset: 129.6, remainingPaintExtent: 395.4, crossAxisExtent: 300.0, crossAxisDirection: AxisDirection.down, viewportMainAxisExtent: 395.4, remainingCacheExtent: 775.1, cacheOrigin: -129.6)
... geometry: SliverGeometry(scrollExtent: 7290.0, paintExtent: 395.4, maxPaintExtent: 7290.0, hasVisualOverflow: true, cacheExtent: 895.4)
... scrollExtent: 7290.0
... paintExtent: 395.4
... maxPaintExtent: 7290.0
... hasVisualOverflow: true
... cacheExtent: 895.4
... currently live children: 33 to 41
RenderObject: RenderSliverList#07b82 relayoutBoundary=up33 NEEDS-LAYOUT NEEDS-COMPOSITING-BITS-UPDATE
needs compositing
parentData: paintOffset=Offset(0.0, 0.0) (can use size)
constraints: SliverConstraints(AxisDirection.right, GrowthDirection.forward, ScrollDirection.forward, scrollOffset: 129.6, remainingPaintExtent: 395.4, crossAxisExtent: 300.0, crossAxisDirection: AxisDirection.down, viewportMainAxisExtent: 395.4, remainingCacheExtent: 775.1, cacheOrigin: -129.6)
geometry: SliverGeometry(scrollExtent: 7290.0, paintExtent: 395.4, maxPaintExtent: 7290.0, hasVisualOverflow: true, cacheExtent: 895.4)
scrollExtent: 7290.0
paintExtent: 395.4
maxPaintExtent: 7290.0
hasVisualOverflow: true
cacheExtent: 895.4
currently live children: 33 to 41
... child with index 33: RenderIndexedSemantics#25906 relayoutBoundary=up34 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
... parentData: index=33; layoutOffset=None (can use size)
... constraints: BoxConstraints(0.0<=w<=Infinity, h=300.0)
... semantic boundary
... size: Size(0.0, 300.0)
... index: 33
... child: RenderRepaintBoundary#f1078 relayoutBoundary=up35 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
..
════════════════════════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════════════════════════
The method '-' was called on null.
Receiver: null
Tried calling: -(129.63384832413118)
The relevant error-causing widget was:
ListView file:///G:/Abc/abc/lib/HomeScreen/HomeScreenDemo.dart:787:34
[+7318 ms] I/flutter (23242): Another exception was thrown: 'package:flutter/src/rendering/sliver.dart': Failed assertion: line 556 pos 15: 'scrollOffsetCorrection != 0.0': is not true.
[ +10 ms] I/flutter (23242): Another exception was thrown: NoSuchMethodError: The method '-' was called on null.
[ +18 ms] I/flutter (23242): Another exception was thrown: 'package:flutter/src/rendering/sliver.dart': Failed assertion: line 556 pos 15: 'scrollOffsetCorrection != 0.0': is not true.
[ +5 ms] I/flutter (23242): Another exception was thrown: NoSuchMethodError: The method '-' was called on null.
[+1620 ms] I/flutter (23242): Another exception was thrown: 'package:flutter/src/rendering/sliver.dart': Failed assertion: line 556 pos 15: 'scrollOffsetCorrection != 0.0': is not true.
[ +1 ms] I/flutter (23242): Another exception was thrown: NoSuchMethodError: The method '-' was called on null.
[ +65 ms] I/flutter (23242): Another exception was thrown: 'package:flutter/src/rendering/sliver.dart': Failed assertion: line 556 pos 15: 'scrollOffsetCorrection != 0.0': is not true.
[ +1 ms] I/flutter (23242): Another exception was thrown: NoSuchMethodError: The method '-' was called on null.
[ +281 ms] I/flutter (23242): Another exception was thrown: 'package:flutter/src/rendering/object.dart': Failed assertion: line 1531 pos 14: '_debugSubtreeRelayoutRootAlreadyMarkedNeedsLayout()': is not true.
[ +5 ms] I/flutter (23242): Another exception was thrown: 'package:flutter/src/rendering/object.dart': Failed assertion: line 1294 pos 12: 'child.parentData != null': is not true.
[ +3 ms] I/flutter (23242): Another exception was thrown: Tried to build dirty widget in the wrong build scope.
[ +508 ms] I/flutter (23242): Another exception was thrown: 'package:flutter/src/rendering/object.dart': Failed assertion: line 1531 pos 14: '_debugSubtreeRelayoutRootAlreadyMarkedNeedsLayout()': is not true.
[ +4 ms] I/flutter (23242): Another exception was thrown: 'package:flutter/src/rendering/object.dart': Failed assertion: line 1294 pos 12: 'child.parentData != null': is not true.
[ +3 ms] I/flutter (23242): Another exception was thrown: Tried to build dirty widget in the wrong build scope.
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 1.20.1, on Microsoft Windows [Version 10.0.19041.388], locale en-IN)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.0)
[√] Android Studio (version 4.0)
[√] Connected device (1 available)
• No issues found!
Here is flutter doctor -v
Flutter (Channel stable, 1.20.1, on Microsoft Windows [Version 10.0.19041.388], locale en-IN)
• Flutter version 1.20.1 at H:\flutter
• Framework revision 2ae34518b8 (5 days ago), 2020-08-05 19:53:19 -0700
• Engine revision c8e3b94853
• Dart version 2.9.0
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.0)
• Android SDK at C:\Users\prave\AppData\Local\Android\sdk
• Platform android-30, build-tools 30.0.0
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
• All Android licenses accepted.
[√] Android Studio (version 4.0)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 48.0.2
• Dart plugin version 193.7361
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
[!] Connected device
! No devices available
! Doctor found issues in 1 category.
Here is Minimal reproducible code
import 'dart:async';
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: MYYApp(),
);
}
}
class MYYApp extends StatefulWidget {
@override
_MYYAppState createState() => _MYYAppState();
}
class _MYYAppState extends State<MYYApp> {
final list = [
'BMW',
'Fiat',
'Toyota',
'Fiat',
'Testa',
'Fiat',
'Ford',
'Fiat',
'BMW',
'Fiat',
'Toyota',
'Fiat',
'Testa',
'Fiat',
'Ford',
'Fiat'
];
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: ListView.builder(
itemCount: list.length,
itemBuilder: (context,index){
return list[index]=='Fiat'? // This Condition check is throwing the error.
Container(
height: 300,
child: Center(child: Text(list[index])),
):Container();
})
),
);
}
}
sweethomedigital, definitelyme, praveengupta0895, japatel225, amitkot and 2 moredefinitelyme and praveengupta0895praveengupta0895
Metadata
Metadata
Assignees
Labels
in triagePresently being triaged by the triage teamPresently being triaged by the triage team