# toDocument method Null safety

1. @override

Map<String, Object?> toDocument()
override

## Implementation

    @override
    Map<String, Object?> toDocument() {
      Map<String, Object?> theDocument = HashMap();
      if (description != null) {
        theDocument["description"] = description;
      } else {
        theDocument["description"] = null;
      }
      if (imageId != null) {
        theDocument["imageId"] = imageId;
      } else {
        theDocument["imageId"] = null;
      }
      if (code != null) {
        theDocument["code"] = code;
      } else {
        theDocument["code"] = null;
      }
      return theDocument;
    }