submitFeedBack static method

Future<void> submitFeedBack({
  1. String? rate,
  2. String? type,
  3. String? description,
})

Implementation

static Future<void> submitFeedBack({
  String? rate,
  String? type,
  String? description,
}) async {
  final deviceServerToken = GlobalAdVariables.deviceServerToken;

  if (deviceServerToken == null) {
    log("fetchRewards:[Device Token]=> ${deviceServerToken?.devicePublicKey}");
    return;
  }
  // PackageInfo packageInfo = await PackageInfo.fromPlatform();

  try {
    await Dio().post(
      "${Urls().baseUrl}user/feedback",
      data: {
        "rate-score": rate,
        "feedback-type": type,
        "feedback-description": description,
        "app_id": GlobalAdVariables.fullJson['id'].toString(),
        "device_public_key": deviceServerToken.devicePublicKey,
      },
      options: Options(
          headers: {"device-public-key": deviceServerToken.devicePublicKey}),
    );
  } on DioException catch (dioError) {
    log("MultiAds:[submitFeedBack]->Dio Error[❌]-> Message -> ${dioError.message.toString()}");
    log("MultiAds:[submitFeedBack]->Dio Error[❌]-> Response -> ${dioError.response!.data.toString()}");
  } catch (error) {
    log("MultiAds:[submitFeedBack]->Catch Error[❌]-> ${error.toString()}");
  }
}