I have followed the sign in and cloud variables tutorials and seen multiple threads for my project involving storing a username for a particular user. I have a firebase database connected to my project as well and initialized the userID variable. However, the cloud variable is only saving while I am staying on the same screen. When I go to a new screen, the data suddenly goes back to null. Below are screenshots of my code.
Some background: chatlist is the main screen after logging in. When you click the settings button on the chatlist screen it takes you to the profile screen. You can “savenewname” on the profile screen.
By “saving while I am staying on the same screen,” I mean that when I save a new name on the profile screen the new name will display, but if I go to another screen and come back it will be back to null.