feat: Added sticky header to display position data
This commit is contained in:
@@ -160,6 +160,7 @@ class _MessageListViewState extends State<MessageListView> {
|
|||||||
return WidgetsVisibilityProvider(
|
return WidgetsVisibilityProvider(
|
||||||
condition: (c) => null,
|
condition: (c) => null,
|
||||||
child: Stack(
|
child: Stack(
|
||||||
|
alignment: Alignment.center,
|
||||||
children: [
|
children: [
|
||||||
NotificationListener<ScrollNotification>(
|
NotificationListener<ScrollNotification>(
|
||||||
onNotification: (_) {
|
onNotification: (_) {
|
||||||
@@ -301,13 +302,13 @@ class _MessageListViewState extends State<MessageListView> {
|
|||||||
child: WidgetsVisibilityListener(
|
child: WidgetsVisibilityListener(
|
||||||
listener: (context, event) {
|
listener: (context, event) {
|
||||||
setState(() {
|
setState(() {
|
||||||
positionData = event.positionDataList.first.startPosition;
|
positionData = event.positionDataList.isNotEmpty ? event.positionDataList[0] : null;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
child: Chip(
|
child: DateDivider(
|
||||||
label: Text(positionData.toString()),
|
dateTime: _messages[positionData].createdAt.toLocal(),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user