I’m building a page like the Telegram group chat, but I’m having trouble giving position sticky to both the date widget and the user’s avatar at the same time.
I tried almost all the packages available for this on pub.dev, including FlutterStickyHeader and FlutterListView, but I could not give the Avatar and Date widgets a Sticky position at the same time because they are in opposite directions.
I also tried to build it myself with CustomScrollView
but again encountered the same problem.
The closest result to what I want was the FlutterListView package, but I can only give a sticky position to one of them at a time.
FlutterListView(
delegate: FlutterListViewDelegate(
(BuildContext context, int index) =>
ListTile(title: Text('List Item ${elements[index]}')),
childCount: elements.length,
onItemSticky: (i) => i % 3 == 0,
),
);
This is a sample code, not a real code.
2
Answers
Please try grouped_list https://pub.dev/packages/grouped_list library to add section.Here you can manage your own section builder. Hope this could help you.
Example
This works fine for me. Try grouped_list https://pub.dev/packages/grouped_list package with groupHeaderBuilder