Widget build(BuildContext context) {
return ListView.builder(
scrollDirection: Axis.horizontal,
shrinkWrap: false,
physics: const BouncingScrollPhysics(),
itemBuilder: (context, int i) {
return Center(
child: Card(
child: GestureDetector(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: const [
SizedBox(
height: 15,
width: 100,
child: ClipRRect(
//borderRadius: BorderRadius.only(topRight: 10,topLeft: 10),
child: Text("admistraction")),
),
Divider(
thickness: 2,
color: Colors.lightBlue,
),
Padding(
padding: EdgeInsets.only(left: 15.0, right: 5),
child: Text(
"Start Learning",
)),
],
),
),
),
);
},
itemCount: 5);
}
Divider horizontal line is not visible in list view.
I tried to wrap a divider in row or column I also wrap it in Container but its not working its working fine with vertical but in horizontal its not visisbale
4
Answers
If you are using
Column
then you should wrap withIntrinsicHeight
and forRow
requiredIntrinsicWidth
to show divider.In your case you are using
Column
you should useIntrinsicHeight
.Try this code:
Try to Add Height to Divider it will work.
Just adding a small sample for reference.
The usage will be:
HorizontalOrLine(height: 10,label: "OR")
Wrap your divider with SizedBox and give height and width
Try adding width to your divider like this