0

I'm using Hive for Flutter. I want to insert every item at position 0 of a box. The items inside the box have to increase index automatically. If I use the 'add' method, the new item inserted takes the last position. This is not good for a List View. The last item inserted must be the first of the list in order to make it visible to the user.

padaleiana
  • 955
  • 1
  • 14
  • 23
Daniel
  • 11
  • 1
  • 6

1 Answers1

0

Keys are automatically sorted, no insertion order is preserved:

Boxes are sorted by lexicographically by key. Keys can either be strings or integers.

https://github.com/hivedb/hive/issues/198

Maxim Saplin
  • 4,115
  • 38
  • 29