Hi, I’m working on something that may be simple.
I have my application that saves information in firebase until there everything is perfect.
but I want it to generate random numbers by default.
I generated manually to identify my tables in realtime database
By hand I wrote example: 2021-05 and all its data in firebase.
what I want is that when scrren1 starts I generate a random number by default.
If I close the app and open it again, it will generate 2 so 3,4,5,6 ect.
I was able to do it, but when I close and reopen it gives me the same number
Then avoid this blocks to be used in initialise. Put this procedure on register button click. So in next screen just you call the tinydb alone and avoid other procedure in other screens. So next time while you open the app or coming from screen 2 to screen 1 number will be 1. Upon clicking the button only you will be generating the sequence.
See if you asked the whole earlier then we would suggest you the best way. But as per your topic i was suggested. So you are facing. Actual problem is, you decided to generate orderly the number upon every register. If so you have to use only in button click. In screen initialize you need to call only tinydb