【发布时间】:2019-04-08 10:30:02
【问题描述】:
下面的代码可以在不使用 Row 小部件的情况下工作,但是在使用带有 Row 的嵌套列表视图时会出错,如果这是上面代码中的用例,我如何使用 Row 我有一行,其中有两列
Widget build(BuildContext context) {
// TODO: implement build
return Scaffold(
appBar: AppBar(
title: Text("Dashboard"),
actions: <Widget>[
IconButton(
icon: Icon(Icons.add_circle),
iconSize: 50.0,
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) => AddMember(),
),
);
},
),
],
),
drawer: MainDrawer(),
body: Container(
decoration: BoxDecoration(
image: Background().buildBackgroundImage(),
),
child: ListView(
children: <Widget>[
Row(
children: <Widget>[
Column(
children: <Widget>[
Text("1"),
],
),
Column(
children: <Widget>[
Text("Hammad"),
ListView.builder(
shrinkWrap: true,
physics: ClampingScrollPhysics(),
itemBuilder: (BuildContext context, int index) {
return Text("data");
},
itemCount: 100,
),
],
),
],
)
],
),
),
);
} }
代码出现以下错误?
I/flutter (6704): RenderShrinkWrappingViewport#9e1c7 relayoutBoundary=up14 NEEDS-LAYOUT NEEDS-PAINT I/flutter(6704):创建者:ShrinkWrappingViewport ← _ScrollableScope ← IgnorePointer-[GlobalKey#aa619] ← 语义 ← 我/颤振(6704):监听器←_GestureSemantics← 我/颤振(6704):RawGestureDetector-[LabeledGlobalKey#dbe17] ← I/flutter (6704): _ScrollSemantics-[GlobalKey#17359] ← RepaintBoundary ← CustomPaint ← RepaintBoundary ← I/flutter (6704): NotificationListener ← ⋯ I/flutter (6704): parentData: (可以使用大小) I/flutter(6704):约束:BoxConstraints(无约束) I/颤振(6704):尺寸:缺失 I/颤动(6704):轴方向:向下 我/颤振(6704):crossAxisDirection:右 I/flutter(6704):偏移量:ScrollPositionWithSingleContext#d8d3b(偏移量:0.0,范围:null..null,视口:null, I/flutter (6704): ScrollableState, ClampingScrollPhysics -> ClampingScrollPhysics, IdleScrollActivity#ce116, I/flutter (6704): ScrollDirection.idle) I/flutter (6704):这个 RenderObject 有以下后代(显示深度为 5): I/flutter (6704): RenderSliverPadding#a684d 需要-布局需要-油漆 I/flutter (6704): RenderSliverList#59143 需要-布局需要-油漆 我/颤振(6704):══════════════════════════════════════════════════════ ══════════════════════════════════════════════════ ═══════ I/flutter (6704):抛出另一个异常:RenderBox 未布置:RenderShrinkWrappingViewport#9e1c7 relayoutBoundary=up14 NEEDS-PAINT I/flutter (6704): 另一个异常被抛出: RenderBox 没有布局: RenderIgnorePointer#0105f relayoutBoundary=up13 NEEDS-PAINT I/flutter(6704):引发了另一个异常:未布置 RenderBox:RenderSemanticsAnnotations#cdf64 relayoutBoundary=up12 NEEDS-PAINT I/flutter (6704): 另一个异常被抛出: RenderBox 没有布局: RenderPointerListener#8301a relayoutBoundary=up11 NEEDS-PAINT I/flutter (6704):抛出另一个异常:RenderBox 未布置:RenderSemanticsGestureHandler#89bf4 relayoutBoundary=up10 NEEDS-PAINT I/flutter(6704):引发另一个异常:RenderBox 未布置:_RenderScrollSemantics#6bd35 relayoutBoundary=up9 NEEDS-PAINT I/flutter (6704): 另一个异常被抛出: RenderBox 没有布局: RenderRepaintBoundary#417b1 relayoutBoundary=up8 NEEDS-PAINT I/flutter(6704):引发另一个异常:未布置 RenderBox:RenderCustomPaint#97f18 relayoutBoundary=up7 NEEDS-PAINT I/flutter(6704):引发另一个异常:未布置 RenderBox:RenderRepaintBoundary#df728 relayoutBoundary=up6 NEEDS-PAINT I/flutter (6704): 另一个异常被抛出: RenderBox 没有布局: RenderFlex#44487 relayoutBoundary=up5 NEEDS-PAINT I/flutter (6704): 另一个异常被抛出: RenderBox 没有布局: RenderFlex#99d5f relayoutBoundary=up4 NEEDS-PAINT I/flutter(6704):引发了另一个异常:'package:flutter/src/rendering/sliver_multi_box_adaptor.dart':断言失败:第 443 行 pos 12:'child.hasSize':不正确。 I/flutter(6704):引发了另一个异常:NoSuchMethodError:在 null 上调用了 getter 'scrollOffsetCorrection'。 I/flutter(6704):引发了另一个异常:NoSuchMethodError:在 null 上调用了方法“debugAssertIsValid”。 I/flutter (6704): 另一个异常被抛出:NoSuchMethodError: The getter 'visible' was called on null.
【问题讨论】:
-
请添加任何您正在寻找的图片?
标签: flutter