Reputation: 527
I have a positioned widget and it has a container as a child. The container has a Listview.seperated as a child but the listview is not scrolling. I tried to change the value of the bottom property but in a range of values , the listview has a small scrolling space at the top but other places wont effect the scrolling.
body: Stack(
overflow: Overflow.visible,
children: <Widget>[
Container(
height: screenSize.height * 0.2 + 150,
width: screenSize.width,
color: Color.fromRGBO(43, 49, 109, 1.0),
),
Positioned(
left: 20,
top: -25,
child: Lottie.asset('assets/gerdali.json',
height: 400,
width: 400,
repeat: false
)),
Positioned(
top: screenSize.height * 0.2 + 20 ,
bottom: -screenSize.height,
right:0.0 ,
left: 0.0,
child: Container(
height: screenSize.height,
width: screenSize.width,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(80.0),
topRight: Radius.circular(80.0)
)
),
child: ListView.separated(
padding: EdgeInsets.only(left: 20.0,right: 20.0,top:80.0),
itemBuilder:(context,index){
return TextField(
decoration: InputDecoration(
filled: true,
fillColor: Colors.white,
hintText: "",
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(40.0)
)
),
);
},
separatorBuilder: (BuildContext,int index){
return SizedBox(
height: 10.0,
);
},
itemCount: 8),
),
),
Positioned(
top: screenSize.height * 0.2 - 60 ,
left: screenSize.width / 2 - 75,
child: RawMaterialButton(
padding: EdgeInsets.all(40.0),
fillColor: Colors.white,
shape: CircleBorder(
side: BorderSide(
color: Colors.black,
width: 1.0
)
),
elevation: 0.0,
child: Icon(
Icons.camera_alt,
color: Colors.grey,
size: 70.0,
),
onPressed: (){},
),)
],
Upvotes: 1
Views: 1075
Reputation: 1451
You can check this code, I just set a scroll view separately to adjust it manually.
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
return Scaffold(
body: Stack(
overflow: Overflow.visible,
children: <Widget>[
Positioned(
top: 0,
child: Container(
height: screenSize.height * 0.2 + 150,
width: screenSize.width,
color: Color.fromRGBO(43, 49, 109, 1.0),
),
),
Positioned(
left: 20,
top: -25,
child: Image.asset('assets/gerdali.json',
height: 400, width: 400, repeat: false)),
Positioned(
top: screenSize.height * 0.2 + 20,
bottom: -screenSize.height,
right: 0.0,
left: 0.0,
child: Container(
height: screenSize.height - (screenSize.height * 0.2 + 20),
width: screenSize.width,
decoration: BoxDecoration(
color: Colors.red,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(80.0),
topRight: Radius.circular(80.0))),
child: Column(
children: [
SizedBox(
height: 50,
),
Container(
height: screenSize.height - (screenSize.height * 0.2 + 70),
width: screenSize.width,
child: ListView.separated(
padding:
EdgeInsets.only(left: 20.0, right: 20.0, top: 30.0),
itemBuilder: (context, index) {
return TextField(
decoration: InputDecoration(
filled: true,
fillColor: Colors.white,
hintText: "",
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(40.0))),
);
},
separatorBuilder: (BuildContext, int index) {
return SizedBox(
height: 10.0,
);
},
itemCount: 10),
),
],
),
),
),
Positioned(
top: screenSize.height * 0.2 - 60,
left: screenSize.width / 2 - 75,
child: RawMaterialButton(
padding: EdgeInsets.all(40.0),
fillColor: Colors.white,
shape: CircleBorder(
side: BorderSide(color: Colors.black, width: 1.0)),
elevation: 0.0,
child: Icon(
Icons.camera_alt,
color: Colors.grey,
size: 70.0,
),
onPressed: () {},
),
),
],
),
);
}
Upvotes: 1