[cloud_firestore]: transaction.update accepts data as Map<String, dynamic> but should allow Object keys for FieldPath #17287
Labels
Needs Attention
This issue needs maintainer attention.
plugin: cloud_firestore
type: enhancement
New feature or request
Is there an existing issue for this?
Which plugins are affected?
Database
Which platforms are affected?
Android
Description
the current implementation uses an incorrect type for the Transaction.update method's data. It only allows for Map<String,dynamic>, that excludes FieldPath as a key. FieldPath is somewhat essential.
Here is the exact line:
flutterfire/packages/cloud_firestore/cloud_firestore/lib/src/transaction.dart
Line 64 in 2a0bdc6
Update: I noted before that only the method signature needs to change, that is not correct. I did look into it a bit further and the platform interfaces also work with a Map<String,dynamic> at this point. However, However, I did not see any reason this limitation should be in place, it's probably just a historically thing.
Reproducing the issue
Try patching data using Map<FieldPath, dynamic>, the signature won't accept it.
Firebase Core version
3.13.0
Flutter Version
3.29.2
Relevant Log Output
Flutter dependencies
No response
Additional context and comments
No response
The text was updated successfully, but these errors were encountered: