games_services 1.0.0
games_services: ^1.0.0

Flutter Android iOS

A new Flutter plugin to support game center and google play games services.

A Flutter plugin to support game center and google play games services.

Screenshot #

iOS

Android

Tutorials #

Written tutorial

Video tutorial Will be added soon.

Apps #

I used this plugin in my app Android && iOS

Usage #

Sign in:

To sign in the user. You need to call the sign in before
making any action (like sending a score or unlocking an achievement).

 GamesServices.signIn();

Show achievements:

To show the achievements screen.

GamesServices.showAchievements();

Show leaderboards:

To show the leaderboards screen.

 GamesServices.showLeaderboards(iOSLeaderboardID: 'ios_leaderboard_id');

Note: You need to pass the leaderboard id for iOS, for android it's not required.

Submit score:

To submit a Score to specific leader board.
-The Score class takes three parameters:
-androidLeaderboardID: the leader board id that you want to send the score for in case of android.
-iOSLeaderboardID the leader board id that you want to send the score for in case of iOS.
-value the score.

GamesServices.submitScore(score: Score(androidLeaderboardID: 'android_leaderboard_id',
                                       iOSLeaderboardID: 'ios_leaderboard_id',
                                       value: 5));

note: You need to pass the leaderboard id for iOS in case of iOS and the leaderboard id for android in case of android.

Unlock achievement:

To unlock an Achievement.
The Achievement takes three parameters:
-androidID the achievement id for android.
-iOSID the achievement id for iOS.
-percentComplete the completion percent of the achievement, this parameter is optional in case of iOS.

GamesServices.unlock(achievement: Achievement(androidID: 'android_id',
                                              iOSID: 'ios_id',
                                              percentComplete: 100)); 

Note: You need to pass the achievement id for iOS in case of iOS and the achievement id for android in case of android. the percentComplete is required in case of iOS but not android.

Installing #

Simply add the following line to your pubspec.yaml file:

dependencies:
  games_services: any       # <-- Add this line
19
likes
90
pub points
71%
popularity

A new Flutter plugin to support game center and google play games services.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

abdelkarem.omareyeh@gmail.com

License

MIT (LICENSE)

Dependencies

flutter, games_services_platform_interface

More

Packages that depend on games_services