trigger method
Future<void>
trigger({
- required BuildContext context,
- String position = initialPosition,
- String? userStatId = "",
- required String event,
- Map<
String, dynamic> ? gameSettingDetails,
override
Implementation
@override
Future<void> trigger({
required BuildContext context,
String position = initialPosition,
String? userStatId = "",
required String event,
Map<String, dynamic>? gameSettingDetails,
}) async {
print('HERE!!!!!!!!!!');
Map<String, dynamic> getChallengesResponse = {};
try {
getChallengesResponse = await fetchChallenges(id, token);
} catch (e) {
print('Null Error: $e');
}
log('getChallengesResponse: ${getChallengesResponse["data"]}',
name: 'ChallengesUi');
late ChallengePageEntity? challengePageEntity;
try {
challengePageEntity = ChallengePageEntity.fromMap(
getChallengesResponse,
);
} catch (e) {
print('Null Error: $e');
}
Navigator.push(
context,
MaterialPageRoute(
builder: (context) {
return ChallengesPage(
challengePageData: challengePageEntity!.data,
);
},
),
);
}