launchEmailLog static method
Implementation
static Future<bool> launchEmailLog(String appTitle, String email, String body) async {
final zipPath = await getLogPath('log.zip');
final logFolder = await getLogPath();
final files = Directory(logFolder) //
.listSync(followLinks: false)
.whereType<File>()
.where((log) => p.extension(log.path) != '.zip')
.map((log) => log)
.toList();
final zip = File(zipPath);
if (zip.existsSync()) zip.deleteSync();
await ZipFile.createFromFiles(
sourceDir: Directory(logFolder),
files: files,
zipFile: zip,
);
return await _sendMail(
body: body,
subject: 'Log ($appTitle)',
recipients: [email],
attachmentPaths: [zipPath],
isHTML: false,
);
}