flutter_logs
flutter_logs copied to clipboard
FlutterLogs.exportLogs doesn't return (await hangs) if there are 0 files
My code is FlutterLogs.exportLogs(exportType: ExportType.ALL);
as a preparation for exporting all logs. My app has a button the user can tap to export logs. However if there wasn't any logging going on so far (0 files) then the function call doesn't return. I see this in the debug log output:
I/ExportTypes(17208): getLogsForAllInRoot: Path: /storage/emulated/0/Android/data/dev.csaba.track_my_indoor_exercise/files/Logs/Logs/, Files: 0
I either need it to return with some special code or need a function call which tells me if there's anything to export so I can enable / disable the button. Currently the QA testers report this as a bug to me because they are clicking on the button and "nothing is happening". I'd like to display a dialog if there's nothing to export.