toMap method

Map<String, dynamic> toMap({
  1. bool forModelJson = false,
})

Implementation

Map<String, dynamic> toMap({bool forModelJson = false}) {
  final ret = <String, dynamic>{};
  ret['id'] = id.toString();
  ret['lastPropertyId'] = lastPropertyId.toString();
  ret['name'] = name;
  if (flags != 0) ret['flags'] = flags;
  ret['properties'] =
      properties.map((p) => p.toMap(forModelJson: forModelJson)).toList();
  ret['relations'] =
      relations.map((r) => r.toMap(forModelJson: forModelJson)).toList();
  if (!forModelJson) {
    ret['backlinks'] = backlinks.map((r) => r.toMap()).toList();
    ret['constructorParams'] = constructorParams;
    ret['nullSafetyEnabled'] = nullSafetyEnabled;
  }
  return ret;
}