mirror of
https://github.com/ImranR98/Obtainium.git
synced 2025-08-10 09:00:15 +02:00
format exported json
Make the exported applications' file more readable in case it is needed to be opened with a text editor.
This commit is contained in:
@@ -1598,12 +1598,13 @@ class AppsProvider with ChangeNotifier {
|
|||||||
}
|
}
|
||||||
String? returnPath;
|
String? returnPath;
|
||||||
if (!pickOnly) {
|
if (!pickOnly) {
|
||||||
|
var encoder = const JsonEncoder.withIndent(" ");
|
||||||
Map<String, dynamic> finalExport = generateExportJSON();
|
Map<String, dynamic> finalExport = generateExportJSON();
|
||||||
var result = await saf.createFile(exportDir,
|
var result = await saf.createFile(exportDir,
|
||||||
displayName:
|
displayName:
|
||||||
'${tr('obtainiumExportHyphenatedLowercase')}-${DateTime.now().toIso8601String().replaceAll(':', '-')}${isAuto ? '-auto' : ''}.json',
|
'${tr('obtainiumExportHyphenatedLowercase')}-${DateTime.now().toIso8601String().replaceAll(':', '-')}${isAuto ? '-auto' : ''}.json',
|
||||||
mimeType: 'application/json',
|
mimeType: 'application/json',
|
||||||
bytes: Uint8List.fromList(utf8.encode(jsonEncode(finalExport))));
|
bytes: Uint8List.fromList(utf8.encode(encoder.convert(finalExport))));
|
||||||
if (result == null) {
|
if (result == null) {
|
||||||
throw ObtainiumError(tr('unexpectedError'));
|
throw ObtainiumError(tr('unexpectedError'));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user