loadLeaderboardScores static method

Future<List<LeaderboardScoreData>?> loadLeaderboardScores({
  1. dynamic iOSLeaderboardID = "",
  2. dynamic androidLeaderboardID = "",
  3. bool playerCentered = false,
  4. required PlayerScope scope,
  5. required TimeScope timeScope,
  6. bool forceRefresh = false,
  7. required int maxResults,
})

Get leaderboard scores as a list. Use this to build a custom UI. To show the device's default leaderboards screen use showLeaderboards.

The forceRefresh argument will invalidate the cache on Android, fetching the latest results. It has no affect on iOS.

Implementation

static Future<List<LeaderboardScoreData>?> loadLeaderboardScores(
    {iOSLeaderboardID = "",
    androidLeaderboardID = "",
    bool playerCentered = false,
    required PlayerScope scope,
    required TimeScope timeScope,
    bool forceRefresh = false,
    required int maxResults}) async {
  return await Leaderboards.loadLeaderboardScores(
      iOSLeaderboardID: iOSLeaderboardID,
      androidLeaderboardID: androidLeaderboardID,
      playerCentered: playerCentered,
      scope: scope,
      timeScope: timeScope,
      maxResults: maxResults,
      forceRefresh: forceRefresh);
}