Skip to content

Issue with index of chat messages.sort function not working. #1

@amolyadav19090007

Description

@amolyadav19090007

Hello I am getting problem as when we do chat message position get change automatically.It should come one after another but it go on upside I think there is problem with sort function which you are using with firebaseanimatedlistview. Problem may be with this sort: (a, b) => b.key.compareTo(a.key),Please answer

child: FirebaseAnimatedList(
reverse: true,
sort: (a, b) => b.key.compareTo(a.key),
query: secretchatref,
itemBuilder: (_, DataSnapshot data,
Animation animation, int index) {
String name = data.value['username'];
ChatMessage message = new ChatMessage.fromSnapshot(
data,
animation,
data.value['username'] == widget.myname
? TextDirection.rtl
: TextDirection.ltr,
name);
return message;
}),
),

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions