what I'm trying to do is fetch data from realtime database in table picture_has_changed, and when pressed that it changes from 0 to 1 and 1 to 0.
This is what I have done so far, but when I try to convert the value it says that it isn't a integer value. So any help would be great.
The code:
openGatePhoto() async {
await Firebase.initializeApp();
FirebaseStorage storage = FirebaseStorage.instance;
var storageReference =
storage.ref().child("picture_has_changed");
if (storageReference == 0) {
storageReference = "1";
} else {
storageReference = "0";
}
I tried using set function also, but it didn't work here it is:
storageReference.child("picture_has_changed").set(val);
Thanks in advance :)
