google/flutter.widgets

Firebase chat scroll with custom index type rather than

Closed this issue · 5 comments

Problem description

Steps to reproduce

Expected behavior

Actual behavior

Environment

Additional details

I want scroll to specific message on my chat app but I can't because the index of jumpTo needs an integer but I have a string id from firebase.

I need help , please.

I have the same case, I need any idea .

Why can't you determine a numeric index from the string ID?

Why can't you determine a numeric index from the string ID?

@jamesderlin
The id is hashed string not number from firebase

The id is hashed string not number from firebase

And why can't you iterate through your messages to find the index of the message with the matching ID? Or create a lookup table that maps IDs to indices? I don't understand what you expect ScrollablePositionedList (which I presume you're asking about) to do that you can't already do yourself.

The id is hashed string not number from firebase

And why can't you iterate through your messages to find the index of the message with the matching ID? Or create a lookup table that maps IDs to indices? I don't understand what you expect ScrollablePositionedList (which I presume you're asking about) to do that you can't already do yourself.

I fixed it like this