toDocument method

  1. @override
Map<String, Object?> toDocument()
override

Implementation

@override
Map<String, Object?> toDocument() {
  final List<Map<String?, dynamic>>? cartItemsListMap = cartItems != null
      ? cartItems!.map((item) => item.toDocument()).toList()
      : null;

  Map<String, Object?> theDocument = HashMap();
  if (appId != null) {
    theDocument["appId"] = appId;
  } else {
    theDocument["appId"] = null;
  }
  if (cartItems != null) {
    theDocument["cartItems"] = cartItemsListMap;
  } else {
    theDocument["cartItems"] = null;
  }
  return theDocument;
}