toMap method
Converts the TransformationOptions instance to a Map.
This method is used for serializing the transformation configuration to JSON or other map-based formats.
Returns:
- Map containing all transformation configuration data
Implementation
Map<String, dynamic> toMap() {
return {
'prepend': prepend,
'append': append,
'match': match,
'nth': nth,
'splitBy': splitBy,
'urldecode': urldecode,
'mapToList': mapToList,
'regexMatch': regexMatch?.toMap(),
'regexReplace': regexReplace?.toMap(),
'replace': replace?.toMap(),
'crop': crop?.toMap(),
'transformationOrder': transformationOrder
?.map((e) => e.toString().split('.').last)
.toList(),
};
}