How to Change width of element inside ListView?
Try wrap it in Row like this:
body: ListView.builder( itemCount: 10, itemBuilder: (ctx, index) { return Row( children:[ SizedBox( width: 10, height: 10, child: Card( color: btnColor, child: Text( "Helo", // loremIpsum, style: TextStyle(color: Colors.black.withOpacity(0.6)), ), ), )] ); }, ),
Widget build(BuildContext context) {var screenWidth = MediaQuery.of(context).size.width;
return Scaffold( body: SingleChildScrollView( child: Container( width: screenWidth / 2, //Takes half of the screen size child: ListView.builder( physics: NeverScrollableScrollPhysics(), itemCount: 10, itemBuilder: (ctx, index) { return Text(index.toString()); }, ), ), ),);
}