Issue
I have the string let's assume "lorem".
From Api I download list with items and one of them contains "lorem" as a field (title).
How I can move that item at the top of the list and don't change positions of other items?
list = downloadedData.items?.map {
Item(
text = it.title,
onClick = Button { }
)
}
Solution
For mutable list:
first search position of lorem
then use removeAt() to remove that item.
Then add searched item at beginning
let item is your searched item
list.removeAt(position)
list.add(0,item)
Answered By - Rasel
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.