Home > Back-end >  How to update a value only once flutter
How to update a value only once flutter

Time:01-04

I want to update a integer type value in firebase database on button pressed ,, but the issue is I want to update the value only once in firebase database on button pressed when user pressed button first time then update the value,, and when user pressed button 2nd or 3rd.... time then don't update the value how can I implement this in flutter?

CodePudding user response:

you can define one more place inside firebase a variable of type bool becomes when the user enters a value, you check that bool variable, and if it is true, you accept the variable entry.then you make the bool variable false and the entry is never provided again

  • Related