Hey, why you are storing create empty list? Doing so, your tag will not be created and hence, you will get error. You can’t store empty value in a tag.
@golumaths100
That was one part of the solution of the problem,
If we do not store an empty list then, the firebase will not accept as a list.
He wants to append to the list, so I am clarifying that if the values is empty I will create an empty list so that the firebase understands that this tag is a list.
It stores the empty list at the first only, then it will not store again. After creating the empty list it goes on appending the item.
If I had not added if block to check if the value is empty it would remove the previous value every time the user clicks fortunately I have added that block.