我正在尝试在 SingleChildScrollView 中使用 PageView.builder 但我总是收到一个错误消息
RenderBox was not laid out: RenderRepaintBoundary#490ce relayoutBoundary=up15 NEEDS-PAINT
'package:flutter/src/rendering/box.dart':
Failed assertion: line 1694 pos 12: 'hasSize'
这是代码的一部分
@override
Widget build(BuildContext context) {
return SafeArea(
child: Scaffold(
body: SingleChildScrollView(
child: PageView.builder(
itemCount: 3,
scrollDirection: Axis.horizontal,
reverse: false,
itemBuilder: (BuildContext context, int index) {
return Padding(
padding: EdgeInsets.symmetric(horizontal: 4.0),
child: Container(
decoration: BoxDecoration(
color: Colors.grey,
borderRadius: BorderRadius.all(Radius.circular(4.0)),
),
),
);
},
)
.....
有什么我应该从代码中添加的吗?