xxxxxxxxxx
//add 2 line inner listview
shrinkWrap: true,
physics: ClampingScrollPhysics(),
xxxxxxxxxx
ListView.builder(
itemCount: data.length,
itemBuilder: (context, index) {
return Padding(
padding: const EdgeInsets.symmetric(vertical: 1, horizontal: 4),
child: Card(
child: ListTile(
onTap: () {
print(data[index]);
},
title: Text(data[index].name),
leading: CircleAvatar(
backgroundImage:
AssetImage('assets/${data[index].avatar}'),
),
),
),
);
}),
xxxxxxxxxx
// add 2 line in inner listview
ListView.builder(
shrinkWrap: true,
physics: ClampingScrollPhysics(),
itemBuilder: (context, index) {
return Container(
child: Text("item"),
);
},
itemCount: 20
)
xxxxxxxxxx
ListView.builder(
itemCount: data.length,
itemBuilder: (context, index) {
return Padding(
padding: const EdgeInsets.symmetric(vertical: 1, horizontal: 4),
child: Card(
child: ListTile(
onTap: () {
print(data[index]);
},
title: Text(data[index].name),
leading: CircleAvatar(
backgroundImage:
AssetImage('assets/${data[index].avatar}'),
),
),
),
);
}),
xxxxxxxxxx
ListView.builder(
itemCount: outerList.length,
itemBuilder: (BuildContext context, int index) {
return ListView.builder(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemCount: innerList.length,
itemBuilder: (BuildContext context, int index) {
return ListTile(
title: Text(innerList[index]),
);
},
);
},
)
xxxxxxxxxx
ListView.separated(
{Key key,
Axis scrollDirection: Axis.vertical,
bool reverse: false,
ScrollController controller,
bool primary,
ScrollPhysics physics,
bool shrinkWrap: false,
EdgeInsetsGeometry padding,
@required IndexedWidgetBuilder itemBuilder,
@required IndexedWidgetBuilder separatorBuilder,
@required int itemCount,
bool addAutomaticKeepAlives: true,
bool addRepaintBoundaries: true,
bool addSemanticIndexes: true,
double cacheExtent,
DragStartBehavior dragStartBehavior: DragStartBehavior.start,
ScrollViewKeyboardDismissBehavior keyboardDismissBehavior: ScrollViewKeyboardDismissBehavior.manual,
String restorationId,
Clip clipBehavior: Clip.hardEdge}
)