toDocument method

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

Implementation

@override
Map<String, Object?> toDocument() {
  final Map<String, dynamic>? colorMap =
      color != null ? color!.toDocument() : null;
  final Map<String, dynamic>? conditionsMap =
      conditions != null ? conditions!.toDocument() : null;

  Map<String, Object?> theDocument = HashMap();
  if (appId != null) {
    theDocument["appId"] = appId;
  } else {
    theDocument["appId"] = null;
  }
  if (description != null) {
    theDocument["description"] = description;
  } else {
    theDocument["description"] = null;
  }
  if (color != null) {
    theDocument["color"] = colorMap;
  } else {
    theDocument["color"] = null;
  }
  if (height != null) {
    theDocument["height"] = height;
  } else {
    theDocument["height"] = null;
  }
  if (thickness != null) {
    theDocument["thickness"] = thickness;
  } else {
    theDocument["thickness"] = null;
  }
  if (indent != null) {
    theDocument["indent"] = indent;
  } else {
    theDocument["indent"] = null;
  }
  if (endIndent != null) {
    theDocument["endIndent"] = endIndent;
  } else {
    theDocument["endIndent"] = null;
  }
  if (conditions != null) {
    theDocument["conditions"] = conditionsMap;
  } else {
    theDocument["conditions"] = null;
  }
  return theDocument;
}