toXmlString method
Converts tcx object to string in XML format, suitable to be written to a '.tcx' file.
The parameters are passed to the XML formatter, their documentation is copied here for convenience :
If pretty is set to true the output is nicely reformatted, otherwise
the tree is emitted verbatim.
The remaining options are used for pretty printing only:
- The option
indentdefines the indention of nodes, by default nodes are indented with 2 spaces. - The option
newLinedefines the printing of new lines, by default the standard new-line'\n'character is used. - The option
levelcustomizes the initial indention level, by default this is0.
Implementation
String toXmlString({
bool pretty = false,
int? level,
String? indent,
String newLine = '\n',
}) {
return _xmlVersionEncoding +
newLine +
XmlDocument(
[_toXmlElement(namespaces: namespacesTcxTrainingCenterDatabase)],
).toXmlString(
pretty: pretty,
level: level,
indent: indent,
newLine: newLine,
);
}