creating scroll view horizontal and vertical in a container in flutter

 body: SingleChildScrollView(

child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
children: [
SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Padding(
padding: const EdgeInsets.only(bottom: 11),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
children: [
Container(
margin: EdgeInsets.only(right: 11),
width: 200,
height: 200,
color: Colors.red,
),
Container(
margin: EdgeInsets.only(right: 11),
width: 200,
height: 200,
color: Colors.green,
),
Container(
margin: EdgeInsets.only(right: 11),
width: 200,
height: 200,
color: Colors.grey,
),
Container(
margin: EdgeInsets.only(right: 11),
width: 200,
height: 200,
color: Colors.black,
),
],
),
),
),
),
Container(
margin: EdgeInsets.only(bottom: 11),
width: 400,
height: 200,
color: Colors.black,
),
Container(
margin: EdgeInsets.only(bottom: 11),
width: 400,
height: 200,
color: Colors.yellow,
),
Container(
margin: EdgeInsets.only(bottom: 11),
width: 400,
height: 200,
color: Colors.blue,
),
],
),
),
),
);

Comments

Popular posts from this blog

swapping the alternate values in given array's element ! 17/11/2022

Learning stage | c++ programs

c++ basic question