me method

Future<MyRank> me(
  1. String leaderboardId, {
  2. LeaderboardPeriod period = LeaderboardPeriod.current,
  3. String? segment,
})

The current user's rank, score, pending count, gap to the next rank and period end (rank null while unranked). Cached for 60 s.

Implementation

Future<MyRank> me(String leaderboardId,
    {LeaderboardPeriod period = LeaderboardPeriod.current, String? segment}) async {
  _requireId(leaderboardId, 'leaderboard_id');
  final j = await _client.call(
    feature: ClikgateFeatures.leaderboards,
    method: 'GET',
    path: _path(leaderboardId, '/me'),
    query: {'period': period.value, if (segment != null) 'segment': segment},
    needsUser: true,
    cacheable: true,
  );
  return MyRank.fromJson(j);
}