Indent xml for saving
This commit is contained in:
@@ -257,8 +257,15 @@ class ModList {
|
|||||||
// Build the XML document
|
// Build the XML document
|
||||||
final xmlDocument = builder.buildDocument();
|
final xmlDocument = builder.buildDocument();
|
||||||
|
|
||||||
// Write the XML document to file
|
// Convert to string with 2-space indentation
|
||||||
file.writeAsStringSync(xmlDocument.toString());
|
final prettyXml = xmlDocument.toXmlString(
|
||||||
|
pretty: true,
|
||||||
|
indent: ' ', // 2 spaces
|
||||||
|
newLine: '\n',
|
||||||
|
);
|
||||||
|
|
||||||
|
// Write the formatted XML document to file
|
||||||
|
file.writeAsStringSync(prettyXml);
|
||||||
logger.info('Successfully saved mod configuration to: $configPath');
|
logger.info('Successfully saved mod configuration to: $configPath');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logger.error('Error saving configuration file: $e');
|
logger.error('Error saving configuration file: $e');
|
||||||
|
@@ -171,9 +171,9 @@ class _ModTroubleshooterWidgetState extends State<ModTroubleshooterWidget> {
|
|||||||
ScaffoldMessenger.of(context).showSnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
SnackBar(
|
SnackBar(
|
||||||
content: Text(
|
content: Text(
|
||||||
'${_loadOrder.order.length} mods prepared for testing. Please use Save button in the Mods tab to save config.',
|
'${_loadOrder.order.length} mods have been successfully saved to the configuration.',
|
||||||
),
|
),
|
||||||
backgroundColor: Colors.orange,
|
backgroundColor: Colors.green,
|
||||||
duration: const Duration(seconds: 4),
|
duration: const Duration(seconds: 4),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user