askForFeedback static method

  1. @Deprecated('This function is deprecated, please use "presentRatingWidgetWithID" instead')
Future<String?> askForFeedback(
  1. String widgetId,
  2. String? closeButtonText
)

Implementation

@Deprecated('This function is deprecated, please use "presentRatingWidgetWithID" instead')
static Future<String?> askForFeedback(String widgetId, String? closeButtonText) async {
  if (!_instance._countlyState.isInitialized) {
    String message = '"initWithConfig" must be called before "askForFeedback"';
    log('askForFeedback, $message', logLevel: LogLevel.ERROR);
    return message;
  }
  log('Calling "askForFeedback":[$widgetId]');
  if (widgetId.isEmpty) {
    String error = 'askForFeedback, widgetId cannot be empty';
    log(error);
    return 'Error : $error';
  }
  log('askForFeedback is deprecated, use presentRatingWidgetWithID instead', logLevel: LogLevel.WARNING);
  final String? result = await presentRatingWidgetWithID(widgetId, closeButtonText: closeButtonText);
  return result;
}