1

I want to use the ListBody widget horizontally inside the Column widget. How can I do this correctly.

Column(
    crossAxisAlignment: CrossAxisAlignment.start,
    mainAxisSize: MainAxisSize.min,
    children: [
      heightS(24),
      Text('John Doe'),
      heightS(16),
      Text('Comment'),
      heightS(12),
      TextField(
        controller: TextEditingController(),
        maxLines: null,
      ),
      heightS(38),
      ListBody(
        mainAxis: Axis.horizontal,
        children: [
          Text(
            'Total marks',
          ),
          widthS(228),
          Text('10'),
        ],
      )
    ],
  );

SizedBox heightS(num h) => SizedBox(height: h.h);
SizedBox widthS(num w) => SizedBox(width: w.w);

DiyorbekDev
  • 706
  • 1
  • 5
  • 19
  • Does this answer your question? [How to add a ListView to a Column in Flutter?](https://stackoverflow.com/questions/45669202/how-to-add-a-listview-to-a-column-in-flutter) – James Jun 09 '22 at 09:18
  • ListBody and ListView are different widgets – DiyorbekDev Jun 09 '22 at 09:21
  • 1
    Why you want to use listybody? any specific reason? Because as per flutter doc https://api.flutter.dev/flutter/widgets/ListBody-class.html , "This widget is rarely used directly. Instead, consider using ListView, which combines a similar layout algorithm with scrolling behavior, or Column, which gives you more flexible control over the layout of a vertical set of boxes." – ABV Jun 09 '22 at 10:07

0 Answers0