trigger method

  1. @override
Future<void> trigger({
  1. required BuildContext context,
  2. required String userStatId,
  3. String position = "FULL_SCREEN",
  4. required String event,
  5. Map<String, dynamic>? gameSettingDetails,
})
override

Implementation

@override
Future<void> trigger({
  required BuildContext context,
  required String userStatId,
  String position = "FULL_SCREEN",
  required String event, //TODO : event
  Map<String, dynamic>? gameSettingDetails,
}) async {
  // print("NudgeBottomSheetsUi: $id, $token, $userStatId, $event, $position");

  BottomSheetsRepo bottomSheetsRepo = BottomSheetsRepo(
    nudgeId: id,
    token: token,
    baseUrl: nudgeUrl,
  );

  NudgeBottomSheets nudgeBottomSheetsData =
      await bottomSheetsRepo.getNudgesBottomSheets();

  print(
      "$type, $event, $token, $nudgeUrl, ${nudgeBottomSheetsData.data.gameId}");

  await submitApi(
    type,
    id,
    event,
    {
      "index": 0,
      "type": nudgeBottomSheetsData.data.nudges[0].type!,
      "action":
          "${nudgeBottomSheetsData.data.nudges[0].type!.toUpperCase()}_OPENED",
      "sizeOfArr": nudgeBottomSheetsData.data.nudges.length,
    },
    token,
    nudgeUrl,
  );

  //_dialogBuilder(context, nudgeBottomSheetsData, 0, event);
}