Repository navigation
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: error messageError messages from the Flutter frameworkError messages from the Flutter frameworka: imagesLoading, displaying, rendering imagesLoading, displaying, rendering imagesc: crashStack traces logged to the consoleStack traces logged to the consolef: scrollingViewports, list views, slivers, etc.Viewports, list views, slivers, etc.found in release: 3.11Found to occur in 3.11Found to occur in 3.11found in release: 3.7Found to occur in 3.7Found to occur in 3.7frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onteam-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team
Description
Is there an existing issue for this?
- I have searched the existing issues
- I have read the guide to filing a bug
Steps to reproduce
This issue is similar to #60578
Run the following code.
Expected results
Should display a wheel of images.
Actual results
Throws exception "Null check operator used on a null value".
Images are displayed only after scrolling the wheel.
Code sample
Code sample
void main(List<String> args) {
runApp(
MaterialApp(
home: Scaffold(
body: ListWheelScrollView.useDelegate(
itemExtent: 400,
childDelegate: ListWheelChildLoopingListDelegate(
children: List.generate(20, (i) => Image.network('https://via.placeholder.com/400')),
),
),
),
),
);
}Screenshots or Video
Logs
Logs
════════ Exception caught by image resource service ════════════════════════════
The following _CastError was thrown while resolving an image:
Null check operator used on a null value
When the exception was thrown, this was the stack
#0 ScrollPosition.minScrollExtent
#1 _FixedExtentScrollPosition.itemIndex
#2 _FixedExtentScrollPosition.copyWith
#3 ScrollPosition.recommendDeferredLoading
#4 Scrollable.recommendDeferredLoadingForContext
#5 ScrollAwareImageProvider.resolveStreamForKey
#6 ImageProvider.resolve.<anonymous closure>
#7 ImageProvider._createErrorHandlerAndKey.<anonymous closure>
#8 SynchronousFuture.then
#9 ImageProvider._createErrorHandlerAndKey
#10 ImageProvider.resolve
#11 _ImageState._resolveImage
#12 _ImageState.didChangeDependencies
#13 StatefulElement._firstBuild
#14 ComponentElement.mount
... Normal element mounting (4 frames)
#18 Element.inflateWidget
#19 Element.updateChild
#20 ListWheelElement.updateChild
#21 ListWheelElement.createChild.<anonymous closure>
#22 BuildOwner.buildScope
#23 ListWheelElement.createChild
#24 RenderListWheelViewport._createChild.<anonymous closure>
#25 RenderObject.invokeLayoutCallback.<anonymous closure>
#26 PipelineOwner._enableMutationsToDirtySubtrees
#27 RenderObject.invokeLayoutCallback
#28 RenderListWheelViewport._createChild
#29 RenderListWheelViewport.performLayout
#30 RenderObject.layout
#31 RenderBox.layout
#32 RenderProxyBoxMixin.performLayout
#33 RenderObject.layout
#34 RenderBox.layout
#35 RenderProxyBoxMixin.performLayout
#36 RenderObject.layout
#37 RenderBox.layout
#38 RenderProxyBoxMixin.performLayout
#39 RenderObject.layout
#40 RenderBox.layout
#41 RenderProxyBoxMixin.performLayout
#42 RenderObject.layout
#43 RenderBox.layout
#44 RenderProxyBoxMixin.performLayout
#45 RenderObject.layout
#46 RenderBox.layout
#47 RenderProxyBoxMixin.performLayout
#48 RenderObject.layout
#49 RenderBox.layout
#50 RenderProxyBoxMixin.performLayout
#51 RenderObject.layout
#52 RenderBox.layout
#53 RenderProxyBoxMixin.performLayout
#54 RenderCustomPaint.performLayout
#55 RenderObject.layout
#56 RenderBox.layout
#57 RenderProxyBoxMixin.performLayout
#58 RenderObject.layout
#59 RenderBox.layout
#60 MultiChildLayoutDelegate.layoutChild
#61 _ScaffoldLayout.performLayout
#62 MultiChildLayoutDelegate._callPerformLayout
#63 RenderCustomMultiChildLayoutBox.performLayout
#64 RenderObject.layout
#65 RenderBox.layout
#66 RenderProxyBoxMixin.performLayout
#67 RenderObject.layout
#68 RenderBox.layout
#69 RenderProxyBoxMixin.performLayout
#70 _RenderCustomClip.performLayout
#71 RenderObject.layout
#72 RenderBox.layout
#73 RenderProxyBoxMixin.performLayout
#74 RenderObject.layout
#75 RenderBox.layout
#76 RenderProxyBoxMixin.performLayout
#77 RenderObject.layout
#78 RenderBox.layout
#79 RenderProxyBoxMixin.performLayout
#80 RenderObject.layout
#81 RenderBox.layout
#82 RenderProxyBoxMixin.performLayout
#83 RenderObject.layout
#84 RenderBox.layout
#85 RenderProxyBoxMixin.performLayout
#86 RenderObject.layout
#87 RenderBox.layout
#88 RenderProxyBoxMixin.performLayout
#89 RenderObject.layout
#90 RenderBox.layout
#91 RenderProxyBoxMixin.performLayout
#92 RenderObject.layout
#93 RenderBox.layout
#94 RenderProxyBoxMixin.performLayout
#95 RenderObject.layout
#96 RenderBox.layout
#97 RenderProxyBoxMixin.performLayout
#98 RenderObject.layout
#99 RenderBox.layout
#100 RenderProxyBoxMixin.performLayout
#101 RenderOffstage.performLayout
#102 RenderObject.layout
#103 RenderBox.layout
#104 RenderProxyBoxMixin.performLayout
#105 RenderObject.layout
#106 RenderBox.layout
#107 _RenderTheatre.performLayout
#108 RenderObject.layout
#109 RenderBox.layout
#110 RenderProxyBoxMixin.performLayout
#111 RenderObject.layout
#112 RenderBox.layout
#113 RenderProxyBoxMixin.performLayout
#114 RenderObject.layout
#115 RenderBox.layout
#116 RenderProxyBoxMixin.performLayout
#117 RenderObject.layout
#118 RenderBox.layout
#119 RenderProxyBoxMixin.performLayout
#120 RenderCustomPaint.performLayout
#121 RenderObject.layout
#122 RenderBox.layout
#123 RenderProxyBoxMixin.performLayout
#124 RenderObject.layout
#125 RenderBox.layout
#126 RenderProxyBoxMixin.performLayout
#127 RenderObject.layout
#128 RenderBox.layout
#129 RenderProxyBoxMixin.performLayout
#130 RenderObject.layout
#131 RenderBox.layout
#132 RenderProxyBoxMixin.performLayout
#133 RenderObject.layout
#134 RenderBox.layout
#135 RenderProxyBoxMixin.performLayout
#136 RenderObject.layout
#137 RenderBox.layout
#138 RenderProxyBoxMixin.performLayout
#139 RenderObject.layout
#140 RenderBox.layout
#141 RenderView.performLayout
#142 RenderObject._layoutWithoutResize
#143 PipelineOwner.flushLayout
#144 RendererBinding.drawFrame
#145 WidgetsBinding.drawFrame
#146 RendererBinding._handlePersistentFrameCallback
#147 SchedulerBinding._invokeFrameCallback
#148 SchedulerBinding.handleDrawFrame
#149 SchedulerBinding.scheduleWarmUpFrame.<anonymous closure>
#153 _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:192:26)
(elided 3 frames from class _Timer and dart:async-patch)
Image provider: ScrollAwareImageProvider<Object>()
Image configuration: ImageConfiguration(bundle: PlatformAssetBundle#e4fea(), devicePixelRatio: 2.8, locale: en_US, textDirection: TextDirection.ltr, platform: android)
Image key: NetworkImage("https://via.placeholder.com/400", scale: 1.0)
════════════════════════════════════════════════════════════════════════════════
Flutter Doctor output
Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.7.12, on Ubuntu 20.04.6 LTS 5.4.0-148-generic,
locale fr_FR.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Linux toolchain - develop for Linux desktop
[✓] Android Studio (version 2021.2)
[✓] IntelliJ IDEA Community Edition (version 2021.3)
[✓] Connected device (2 available)
[✓] HTTP Host Availability
• No issues found!Reacted by Zahid Shaikh
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: error messageError messages from the Flutter frameworkError messages from the Flutter frameworka: imagesLoading, displaying, rendering imagesLoading, displaying, rendering imagesc: crashStack traces logged to the consoleStack traces logged to the consolef: scrollingViewports, list views, slivers, etc.Viewports, list views, slivers, etc.found in release: 3.11Found to occur in 3.11Found to occur in 3.11found in release: 3.7Found to occur in 3.7Found to occur in 3.7frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onteam-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team

Activity
Sarraj-Sahar commentedon May 3, 2023
Are you sure the issue isn't related to the network image link you're providing ? I changed the URL and it works for me.
Code sample
Z6P0 commentedon May 3, 2023
I tried with your image URL and many others and it's the same bug.
I also tried with different Android emulator versions.
darshankawar commentedon May 4, 2023
Thanks for the report. Using the code sample provided and with different urls, I am able to replicate the reported error using latest master and stable versions.
I think it has to do with the type of
childDelegateyou are passing, in this case, isListWheelChildLoopingListDelegate.I tried with another
childDelegateas below with which too it throws the same error.stable, master flutter doctor -v
TahaTesser commentedon May 4, 2023
ListWheelScrollViewis not a material widget.https://api.flutter.dev/flutter/widgets/ListWheelScrollView-class.html
hgandhi67 commentedon Sep 7, 2023
Able to reproduce in 3.13.3 version as well.
bpjhe commentedon Jan 29, 2025
Just wanted to chime in and say I stumbled upon the same problem (v3.27.1). Been trying to find a workaround but no luck. I managed to get the initial selected item to load an image by using a custom image provider, but the other ones on the screen will not load until they have been off-screen.
Fix ListWheelScrollView null check error when it reads itemIndex befo…