toMap method

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

Converts this DTO to a map suitable for database updates.

Returns a map with column names as keys. Only fields that were explicitly set should be included, allowing partial updates.

Implementation

@override
Map<String, Object?> toMap() {
  return <String, Object?>{
    if (layerTwoFlag != null) 'layer_two_flag': layerTwoFlag,
    if (layerOneNotes != null) 'layer_one_notes': layerOneNotes,
    if (id != null) 'id': id,
    if (baseName != null) 'base_name': baseName,
  };
}