Why are my first date and first 2 items correctly built but not the rest? The first date header wrap my text correctly but the padding is incorrect and the rest has the correct padding but does not wrap my text. This is how it looks like right now.
GroupedListView<dynamic, String>(
shrinkWrap: true,
elements: activityList,
groupBy: (element) => element['date'].substring(0, 10),
groupSeparatorBuilder: (String groupByValue) =>
child: Container(
height: 35,
width: 125,
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(25),
color: themeProvider.isDarkMode
? Color(0xFF64B6F7)
: Color(0xFFFFCC00),
),
child: Center(child: Text(...))
),
itemComparator: (item1, item2) =>
item1['date'].compareTo(item2['date']),
itemBuilder: (context, element) {
return Card(
elevation: 5,
margin: EdgeInsets.symmetric(vertical: 15),
child: ListTile(
//listtile
),
);},
useStickyGroupSeparators: true,
floatingHeader: true,
)
The problem is caused by useStickyGroupSeparators but I would want to use that.
Based on your code, I tried to reproduce the effect. Is this what you want to achieve?
The code:
Mock data: