handle method
Method called when report has been accepted by user
Implementation
@override
Future<bool> handle(Report report, BuildContext? context) async {
if (report.platformType != PlatformType.web &&
!(await Catcher2Utils.isInternetConnectionAvailable())) {
_printLog('No internet connection available');
return false;
}
var message = '';
if (customMessageBuilder != null) {
message = await customMessageBuilder!(report);
} else {
message = _buildMessage(report);
}
final messages = _setupMessages(message);
for (final value in messages) {
final isLastMessage = messages.indexOf(value) == messages.length - 1;
final result =
await _sendContent(value, isLastMessage ? report.screenshot : null);
if (!result) {
return result;
}
}
return true;
}