reportFeedbackWidgetManually static method

Future<String?> reportFeedbackWidgetManually(
  1. CountlyPresentableFeedback widgetInfo,
  2. Map<String, dynamic> widgetData,
  3. Map<String, Object> widgetResult
)

Report widget info and do data validation CountlyPresentableFeedback widgetInfo - identifies the specific widget for which the feedback is filled out Map<String, dynamic> widgetData - widget data for this specific widget Map<String, Object> widgetResult - segmentation of the filled out feedback. If this segmentation is null, it will be assumed that the survey was closed before completion and mark it appropriately returns error or success message

Implementation

static Future<String?> reportFeedbackWidgetManually(CountlyPresentableFeedback widgetInfo, Map<String, dynamic> widgetData, Map<String, Object> widgetResult) async {
  if (!_instance._countlyState.isInitialized) {
    String message = '"initWithConfig" must be called before "reportFeedbackWidgetManually"';
    log('reportFeedbackWidgetManually, $message', logLevel: LogLevel.ERROR);
    return message;
  }
  String widgetId = widgetInfo.widgetId;
  String widgetType = widgetInfo.type;
  log('Calling "reportFeedbackWidgetManually":[$presentFeedbackWidget] with Type:[$widgetType]');
  List<String> widgetInfoList = [];
  widgetInfoList.add(widgetId);
  widgetInfoList.add(widgetType);
  widgetInfoList.add(widgetInfo.name);

  List<dynamic> args = [];
  args.add(widgetInfoList);
  args.add(widgetData);
  args.add(widgetResult);

  String? result;
  try {
    result = await _channel.invokeMethod('reportFeedbackWidgetManually', <String, dynamic>{'data': json.encode(args)});
  } on PlatformException catch (e) {
    result = e.message;
  }

  return result;
}