I'm trying to check if a field exists in my documentSnapshot.
My code:
document.data.containsKey('field_name')
But I'm getting:
error: The method 'containsKey' isn't defined for the type 'Function'.
Any suggestions?
I'm trying to check if a field exists in my documentSnapshot.
My code:
document.data.containsKey('field_name')
But I'm getting:
error: The method 'containsKey' isn't defined for the type 'Function'.
Any suggestions?
Try it like this:
(document.data() as Map<String,dynamic>).containsKey('field_name');