I have a Flutter mobile application, where several people can read the same firestore document in real time using StreamBuilder (obviously one person can leave the room). At the same time, to switch from one screen to another, I have a 30 second counter (I use the package https://pub.dev/packages/flutter_countdown_timer). When the counter reaches 0, I update a field in the firestore document (increment the field by 1) and I go to another screen.
What is the best solution to guarantee that the document update will be done by a single user (single instance of the app) and to prevent a false operation (do two increments for example)