Thank you for your reply. I changed the starting number of the list to 0 (my mistake!) and this variable “sizeDB” is a number I add manually in the global variable. I didn’t know how to code to return the size of my DB and this way I solved my problem temporarily.
Working with localDB was perfect for me, except that I couldn’t update the value. I changed my whole app to work with firebase, but now I struggle with simple things like filtering it.
The first exemple, when I want the app to store a VALUE if VALUE=0, it returns an empty list. But if I remove the IF statement (my filter), and ask the app to build the list, it runs perfectly and returns all items I have there.
(Don’t know why, but I have to ask the app to wait 1 second otherwise it returns repetitive itens)
Then if I ask it to display the error message, it crashes. No matter where the error is put (inside/outside the IF statement)