会偶现某一个item为空白的情况
jaysonss opened this issue · 6 comments
Flutter doctor info:
[✓] Flutter (Channel unknown, v1.14.6, on Mac OS X 10.14.6 18G84, locale
zh-Hans-CN)
• Flutter version 1.14.6 at /Users/huangyumeng/flutter/sdk/flutter
• Framework revision fabeb2a16f (4 months ago), 2020-01-28 07:56:51 -0800
• Engine revision c4229bfbba
• Dart version 2.8.0 (build 2.8.0-dev.5.0 fc3af737c7)
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.0)
• Android SDK at /Users/huangyumeng/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling
support)
• Platform android-29, build-tools 29.0.0
• 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)
! Some Android licenses not accepted. To resolve this, run: flutter doctor
--android-licenses
[✓] 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.4
[✓] Android Studio (version 3.6)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 45.1.1
• Dart plugin version 192.8052
• Java version OpenJDK Runtime Environment (build
1.8.0_212-release-1586-b4-5784211)
[✓] Connected device (1 available)
• Redmi Note 8 Pro • 192.168.1.53:5555 • android-arm64 • Android 9 (API 28)
! Doctor found issues in 1 category.
问题描述:
产品瀑布流默认为两列,会偶现第二列某一个区域为空白的情况,滑动后第二列整个消失,第一列的布局会挤在一起。布局代码:
SliverPadding(
padding: EdgeInsets.all(kMomentWaterfallCrossAxisSpacing),
sliver: SliverWaterfallFlow(
gridDelegate: SliverWaterfallFlowDelegate(
crossAxisCount: kMomentWaterfallCrossAxisCount,
mainAxisSpacing: kMomentWaterfallMainAxisSpacing,
crossAxisSpacing: kMomentWaterfallCrossAxisSpacing,
lastChildLayoutTypeBuilder: (idx) {
return idx == _model.momentList.length
? LastChildLayoutType.foot
: LastChildLayoutType.none;
},
viewportBuilder: (firstIdx, lastIdx) {},
collectGarbage: (List<int> collectIdxList) {
for (int idx in collectIdxList) {
dataList[idx].evictImageInfo();
}
}),
delegate: SliverChildBuilderDelegate((context, idx) {
return ItemTile();
}, childCount: dataList.length),
),
)
Bugly报错:
NoSuchMethodError: The getter 'parentData' was called on null. Receiver: null Tried calling: parentData
#0 CrossAxisItems.insertLeading (package:waterfall_flow/src/rendering/sliver_waterfall_flow.dart:569)
2 #1 RenderSliverWaterfallFlow.performLayout (package:waterfall_flow/src/rendering/sliver_waterfall_flow.dart:199)
3 #2 RenderObject.layout (package:flutter/src/rendering/object.dart:1767)
4 #3 RenderSliverEdgeInsetsPadding.performLayout (package:flutter/src/rendering/sliver_padding.dart:134)
5 #4 RenderSliverPadding.performLayout (package:flutter/src/rendering/sliver_padding.dart:373)
6 #5 RenderObject.layout (package:flutter/src/rendering/object.dart:1767)
7 #6 RenderViewportBase.layoutChildSequence (package:flutter/src/rendering/viewport.dart:452)
8 #7 RenderViewport._attemptLayout (package:flutter/src/rendering/viewport.dart:1444)
9 #8 RenderViewport.performLayout (package:flutter/src/rendering/viewport.dart:1353)
10 #9 RenderObject._layoutWithoutResize (package:flutter/src/rendering/object.dart:1628)
11 #10 PipelineOwner.flushLayout (package:flutter/src/rendering/object.dart:888)
12 #11 RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:401)
13 #12 WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:797)
14 #13 RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:283)
15 #14 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1109)
16 #15 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1048)
17 #16 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:964)
18 #17 _rootRun (dart:async/zone.dart:1126)
19 #18 _CustomZone.run (dart:async/zone.dart:1023)
20 #19 _CustomZone.runGuarded (dart:async/zone.dart:925)
21 #20 _invoke (dart:ui/hooks.dart:260)
22 #21 _drawFrame (dart:ui/hooks.dart:218)
最新版本? 请提供一下可以重现的demo
版本是0.1.3
OK
OK
测试之后,请反馈是否修复,谢谢
@zmtzawqlp 最近似乎没有再遇到这个问题了😃