toJson method

  1. @override
Map<String, dynamic> toJson()
override

Converts the object to a Firestore-compatible map.

Returns a Map with string keys and dynamic values that can be directly written to Firestore. All complex objects should be converted to basic Firestore-supported types.

Example:

@override
Map<String, dynamic> toJson() => {
  'field1': value1,
  'field2': value2,
};

Implementation

@override
Map<String, dynamic> toJson() {
  // For generic types, toJson() cannot be implemented without type converters.
  // Use toJsonWithConverters() instead with appropriate converters.
  throw UnimplementedError(
    'ScriptDto.toJson() requires type converters. Use toJsonWithConverters() instead.',
  );
}