sendFeedback method

  1. @override
Future<void> sendFeedback(
  1. int type,
  2. String feedbackMessage,
  3. bool includeLogs,
  4. bool includeDiagnostics, {
  5. String? guestMailId,
  6. bool forceToAnonymous = false,
  7. List<Uri>? attachmentsUri,
})
override

Implementation

@override
Future<void> sendFeedback(int type, String feedbackMessage,
    bool includeLogs, bool includeDiagnostics,
    {String? guestMailId,
    bool forceToAnonymous = false,
    List<Uri>? attachmentsUri}) async {
  try {
    List<String> attachments = [];
    if (attachmentsUri != null) {
      for (final uri in attachmentsUri) {
        attachments.add(uri.toString());
      }
    }

    final params = {
      "type": type,
      "feedbackMessage": feedbackMessage,
      "includeLogs": includeLogs,
      "includeDiagnostics": includeDiagnostics,
      "guestMailId": guestMailId,
      "forceToAnonymous": forceToAnonymous,
      "attachmentsUri": attachments.isEmpty ? null : attachments
    };
    return methodChannel.invokeMethod<void>("sendFeedback", params);
  } on PlatformException catch (e, s) {
    print(s);
    return;
  }
}