You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Good Day! New to riverpod and freezed, I encountered this problem when pushing to firestore, I have freezed classes that are nested to each other, all have the @JsonSerializable(explicitToJson: true) but I encounter this problem, when trying to upload to firestore. What am I missing? to make this work. Thank you!
[cloud_firestore/invalid-argument] Function setDoc() called with invalid data. Unsupported field value: a custom _$36ProductDimensionImpl object (found in document orders/-O6CM27hmACSNq4q8tPs/cart-items/-O6CM27h1OVrA1phAHhm)
part "main_panel.freezed.dart";
part "main_panel.g.dart";
//
///The CART ITEM OR MAIN PANEL
@freezed
class MainPanel with _$MainPanel {
@JsonSerializable(explicitToJson: true)
MainPanel._();
factory MainPanel({
String? id,
@Default(1) int quantity,
FProduct? product,
Shape? shape,
List<String>? uploadedImages,
List<SubPanel>? subPanels,
int? created,
int? modified,
}) = _MainPanel;
double computeSubPanelsTotalAmount() {
double total = 0.0;
if (subPanels == null || subPanels!.isEmpty) {
return total;
}
for (SubPanel subPanel in subPanels!) {
total += subPanel.getTotalAmount();
}
return total * quantity;
}
factory MainPanel.fromJson(Map<String, dynamic> json) =>
_$MainPanelFromJson(json);
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Good Day! New to riverpod and freezed, I encountered this problem when pushing to firestore, I have freezed classes that are nested to each other, all have the
@JsonSerializable(explicitToJson: true)
but I encounter this problem, when trying to upload to firestore. What am I missing? to make this work. Thank you!Beta Was this translation helpful? Give feedback.
All reactions