download static method
Creates and downloads the report as a .txt file.
Implementation
static Future<void> download({
List<RxSession>? sessions,
SessionId? sessionId,
String? userAgent,
MyUser? myUser,
DeviceToken? token,
bool? pushNotifications,
}) async {
try {
final encoder = Utf8Encoder();
final file = await PlatformUtils.createAndDownload(
'report_${DateTime.now().millisecondsSinceEpoch}.log',
encoder.convert(
LogController.report(
sessions: sessions,
sessionId: sessionId,
userAgent: userAgent,
myUser: myUser,
token: token,
pushNotifications: pushNotifications,
),
),
);
if (file != null && PlatformUtils.isMobile) {
await SharePlus.instance.share(ShareParams(files: [XFile(file.path)]));
}
} catch (e) {
MessagePopup.error(e);
}
}