convert
Converts vector icon content into Kotlin Compose code by processing it through optimization, parsing, and code generation stages.
This function emits conversion progress steps through a Flow, allowing consumers to track the conversion process. The conversion pipeline includes optional optimization of the input content, parsing the vector format into an intermediate representation, and generating the final Kotlin code for Compose ImageVector.
The conversion process follows these stages:
Optimizing (optional) - if an optimizer is provided, the content is optimized
Parsing - the vector content is parsed according to the file type
Generating - Kotlin code is generated from the parsed icon
Complete - emits the final conversion result
If any error occurs during the conversion process, an Error step is emitted containing the exception details.
Return
a Flow of ConversionStep instances representing the progress and result of the conversion
Parameters
the raw string content of the vector icon file
the name to be used for the generated icon in Kotlin code
the parser configuration containing package name, theme, and other generation options
the type of vector file being converted (defaults to SVG)
optional optimizer to preprocess the content before parsing