Widget build(BuildContext context) {
super.build(context);
SystemChrome.setEnabledSystemUIOverlays(SystemUiOverlay.values);
return AnnotatedRegion<SystemUiOverlayStyle>(
value: SystemUiOverlayStyle(
statusBarColor: Colors.transparent,
),
child: Scaffold(
key: _scaffoldKeyProfilePage,
backgroundColor: Colors.white,
body: user == null
? Center(
child: CircularProgressIndicator(),
)
: RefreshIndicator(
onRefresh: _onRefresh,
child: ListView(
shrinkWrap: true,
padding: EdgeInsets.all(0),
children: [
BuildMainProfile(
....//build profile (with heiht = ScreenHeight/1.4)
),
Container(
...//to build bio section
),
Flexible(
child: PageView(
children: [
ListView.builder(
shrinkWrap: true,
itemCount: 30,
itemBuilder: (BuildContext context, int index) {
return Padding(
padding: const EdgeInsets.all(8.0),
child: Container(color: index%2==0?Colors.red:Colors.green,height: 30.0,width: double.infinity,),
);
},
),
Container(height: 400,width: 200,color: Colors.green,),
Container(height: 400,width: 200,color: Colors.blue,),
Container(height: 400,width: 200,color: Colors.pink,)
],
),
)
],
),
),
),
);
I am getting an error saying :
The ParentDataWidget Flexible(flex: 1) wants to apply ParentData of
type FlexParentData to a I/flutter ( 9926): RenderObject, which has
been set up to accept ParentData of incompatible type ParentData.
I/flutter ( 9926): Usually, this means that the Flexible widget has
the wrong ancestor RenderObjectWidget. Typically, I/flutter ( 9926):
Flexible widgets are placed directly inside Flex widgets. I/flutter (
9926): The offending Flexible is currently placed inside a
RepaintBoundary widget.
.
.
.
.
Another exception was
thrown: Horizontal viewport was given unbounded height. I/flutter (
9926): Another exception was thrown: RenderBox was not laid out:
RenderViewport#4dd2b NEEDS-LAYOUT NEEDS-PAINT
NEEDS-COMPOSITING-BITS-UPDATE I/flutter ( 9926): Another exception was
thrown: RenderBox was not laid out: RenderViewport#4dd2b NEEDS-PAINT
NEEDS-COMPOSITING-BITS-UPDATE
How can this error be removed, I have even used Flexible over PageView and shrinkWrap in listView.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…