ChallengesApi class

A class to handle API interactions related to challenges (gamification).

Constructors

ChallengesApi({required Dio dio, required String baseUrl, required String apiKey})
Constructs a ChallengesApi instance.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

claimReward({required String id, required int rewardIndex, required String companyId}) Future<ApiResponseModel<bool?>>
Claims a community reward.
claimTask({required String id, required String taskKey, required String companyId}) Future<ApiResponseModel<ChallengeModel?>>
Claims XP reward for completing a task.
get({required String id, required String companyId}) Future<ApiResponseModel<ChallengeModel?>>
Gets details of a specific challenge.
join({required String id, required String companyId}) Future<ApiResponseModel<bool?>>
Joins a challenge.
leaderboard({required String id, required String companyId}) Future<ApiResponseModel<List<ChallengeLeaderboardEntryModel>>>
Gets the leaderboard for a challenge.
leave({required String id, required String companyId}) Future<ApiResponseModel<bool?>>
Leaves a challenge.
list({required String companyId, ChallengeType? type, ChallengeStatus? status}) Future<ApiResponseModel<List<ChallengeModel>>>
Lists available challenges.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited