from the previous question that I have posted, I already managed to send a push notification to all device. Previously, I am using the different version of plugin which are:
firebase_core: ^1.0.1
cloud_firestore: ^1.0.1
firebase_dynamic_links: ^0.8.0
But, there are some issue on compatibility for my firebase connection as I need to change from
classpath 'com.google.gms:google-services:4.3.5'
to
classpath 'com.google.gms:google-services:4.3.8'
So, due to compatibility issue, i need to change the version of plugin as well to
firebase_core: ^1.2.0
cloud_firestore: ^2.2.0
However, after change the version. Some of my code didn't work. My concern is on how to specify which field that I want to call using snapshot.data()
. Previously, I am using snapshot.data()['token']
and it's work fine. But after I change version on firebase_core
, I cannot using that method again. It stated error which is:
Error: The operator '[]' isn't defined for the class 'Object'.
- 'Object' is from 'dart:core'. Try correcting the operator to an existing operator, or defining a '[]' operator. 'to': snapshot.data() ['tokenID'],
Can anyone help me on this issue? Thank you in advanced! You many check the full code here