I have 2 listview row widgets inside and I put them inside a SingleChildScrollView so that both have the same scroll. But nothing is visible.
Here is the code:
child: Row(children: [
SingleChildScrollView(
child: Row(
children: [
Expanded(
child: ListView(
physics: NeverScrollableScrollPhysics(),
controller: _scrollController2,
children: your_history.map((item) {
return Column(
children: [
Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Column(
children: [
Text("Sizning javobingiz:"),
Text(item)
],
),
],
),
),
Divider(
color: Colors.black,
),
],
);
}).toList(),
),
),
Expanded(
child: ListView(
physics: NeverScrollableScrollPhysics(),
controller: _scrollController,
children: true_history.map((item) {
return Column(
children: [
Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Column(
children: [Text("To'g'ri javob:"), Text(item)],
),
],
),
),
Divider(
color: Colors.black,
),
],
);
}).toList(),
),
),
],
),
),
]),
SingleChildScrollView ning ichiga joyladim. Ammo hech narsa ko’rinmayabdi.
only String lists are used
the error is as follows:
RenderBox was not laid out: RenderPointerListener#fb2be relayoutBoundary=up5 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
'package:flutter/src/rendering/box.dart':
Failed assertion: line 1966 pos 12: 'hasSize'
3
Answers
Remove the first
Row
andSingleChildScrollView
and it will start working.You don’t need a
SingleChildScrollView
to make the list scrollable cause the ListView is scrollable itself.removing singlechildscrollview will work