title: Flutter nested ListView.separated
body: <p>I'd like to have a ListView of columns that could scroll horizontally and in each of those columns a ListView of rows that could scroll vertically.</p>
  <p>Here's the code that I wrote:</p>
  <pre><code>@override
  Widget build(BuildContext context) {
    return Center(
      child: Column(
        mainAxisAlignment: MainAxisAlignment.start,
        mainAxisSize: MainAxisSize.min,
        children: [
          Text(
            &quot;AppName&quot;,
            textAlign: TextAlign.center,
          ),
          Expanded(
            //This is the first ListView, the itemBuilder returns a Column
            child: ListView.separated(
              scrollDirection: Axis.horizontal,
              controller: scrollController,
              itemCount: filesProvider.directories.length,
              itemBuilder: (BuildContext context, int index) {
                return buildColumn(context, index, filesProvider);
              },
              separatorBuilder: (BuildContext context, int index) {
                return SizedBox(
                  width: 30,
                );
              },
            ),
          ),
        ],
      ),
    );
  }
  
  Column buildColumn(BuildContext context, int index, FilesProvider provider) {
    return Column(
      children: [
        Text(
          &quot;Column &quot;+index,
          textAlign: TextAlign.center,
        ),
        Expanded(
          //This is the second ListView, the itemBuilder returns a Row
          child: ListView.separated(
            scrollDirection: Axis.vertical,
            controller: scrollController,
            itemCount: (provider.dirNames[index].length / colonnePerTipo).round(),
            itemBuilder: (BuildContext context, int rowIndex) {
              return buildRow(context, rowIndex, provider);
            },
            separatorBuilder: (BuildContext context, int rowIndex) {
              return SizedBox(
                width: 10,
              );
            },
          ),
        ),
      ],
    );
  }
  
  Row buildRow(BuildContext context, int index, FilesProvider provider) {
    List&lt;Widget&gt; sizedBoxes = [];
  
    for (int i = 0; i &lt; buttonForRow; i++) {
      sizedBoxes.add(
        SizedBox(
          width: 20,
          child: ElevatedButton(
            child: Text(&quot;Button&quot;),
          ),
        ),
      );
    }
  
    return Row(
      mainAxisAlignment: MainAxisAlignment.spaceEvenly,
      children: sizedBoxes,
    );
  }
  </code></pre>
  <p>It seems fine to me but when I run it I receive this error:</p>
  <pre><code>======== Exception caught by rendering library =====================================================
  The following assertion was thrown during paint():
  RenderBox was not laid out: RenderRepaintBoundary#29de6 relayoutBoundary=up2 NEEDS-PAINT
  'package:flutter/src/rendering/box.dart':
  Failed assertion: line 1929 pos 12: 'hasSize'
  </code></pre>
  <p>I don't understand what the problem could be.
  Can someone help me?</p>