trigger method
Future<void>
trigger({
- required BuildContext context,
- required String userStatId,
- String position = "FULL_SCREEN",
- required String event,
- Map<
String, dynamic> ? gameSettingDetails, - int? storyIndex,
- int? slideIndex,
- bool? deepLinkMode,
- String? deepLinkType,
override
Implementation
@override
Future<void> trigger({
required BuildContext context,
required String userStatId,
String position = "FULL_SCREEN",
required String event,
Map<String, dynamic>? gameSettingDetails,
int? storyIndex,
int? slideIndex,
bool? deepLinkMode,
String? deepLinkType,
// slideIndex, storyIndex, deepLinkMode, type
}) async {
storiesRepo = StoriesRepo(
nudgeId: id,
token: token,
baseUrl: nudgeUrl,
);
final fetchedStories = await storiesRepo.getStories();
_streamController.add(
StoriesData(
storiesRepo: storiesRepo,
data: fetchedStories,
token: token,
nudgeId: id,
),
);
// TODO: DO NOT DELETE THIS CODE, trust me you will need it
// deepLinkMode = true;
// storyIndex = 1;
// slideIndex = 2;
// deepLinkType = "SINGLE_SLIDE";
// if (deepLinkMode != null && deepLinkMode) {
// log("Deep Link Mode: $deepLinkMode", name: "NudgeStoriesUi");
// if (deepLinkType == "SINGLE_STORY") {
// storyIndex = storyIndex ?? 0;
// slideIndex = 0;
// } else if (deepLinkType == "SINGLE_SLIDE") {
// storyIndex = storyIndex ?? 0;
// slideIndex = slideIndex ?? 0;
// } else if (deepLinkType == "ALL_STORIES") {
// storyIndex = 0;
// slideIndex = 0;
// }
//
// _streamController.add(
// StoriesData(
// data: fetchedStories,
// token: token,
// nudgeId: id,
// storyIndex: 0,
// slideIndex: 1,
// deepLinkMode: true,
// deepLinkType: "SINGLE_SLIDE",
// ),
// );
// } else {
// _streamController.add(
// StoriesData(
// storiesRepo: storiesRepo,
// data: fetchedStories,
// token: token,
// nudgeId: id,
// ),
// );
// }
}