We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Thanks for this great package! I am having one problem. I am getting an error when using setList to write a list of maps.
When I try and write to firestore and update a document with the setList option it gives me an error.
Unsupported operation: Value of type minified:b1 is not supported by Firestore.
I have a model that has a list of activities (a log of what the property has done)
class Property { String id; String owner; String email; List<Invoice> invoices; List<LogModel> activity; Property( {this.id, this.owner, this.email, this.activity}); factory Property.fromMap(Map data) { return Property( id: data['id'], owner: data['owner'] ?? '', email: data['email'] ?? '', activity: (data['activity'] as List ?? []) .map((v) => LogModel.fromMap(v)) .toList(), ); } Map<String, dynamic> toJson() => { "id": id, "owner": owner, "email": email, "activity": List<dynamic>.from(activity.map((x) => x.toJson())), }; } class LogModel { String id; String user; String message; int date; LogModel({this.id, this.user, this.message, this.date}); LogModel.fromMap(Map data) { id = data['id']; user = data['user'] ?? ''; message = data['message'] ?? ''; date = data['date']; } Map<String, dynamic> toJson() => { "id": id, "user": user, "message": message, "date": date, }; }
UpdateData propertyData = UpdateData(); propertyData.setString("email", property.email); propertyData.setList("activity", property.activity); final ref = app.firestore().document('/properties/${property.id}'); await ref.updateData(propertyData);
Thanks so much for any advice on how to handle this situation when it is a list of Maps.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Thanks for this great package! I am having one problem. I am getting an error when using setList to write a list of maps.
When I try and write to firestore and update a document with the setList option it gives me an error.
I have a model that has a list of activities (a log of what the property has done)
Thanks so much for any advice on how to handle this situation when it is a list of Maps.
The text was updated successfully, but these errors were encountered: