Games_services
所属分类:Flutter开发
开发工具:Dart
文件大小:2566KB
下载次数:0
上传日期:2023-04-19 21:24:47
上 传 者:
sh-1993
说明: 支持游戏中心和谷歌游戏服务的Flutter插件
(A Flutter plugin to support game center and google play games services)
文件列表:
.idea (0, 2023-04-20)
.idea\games_services.iml (1163, 2023-04-20)
.idea\libraries (0, 2023-04-20)
.idea\libraries\Dart_SDK.xml (1945, 2023-04-20)
.idea\modules.xml (280, 2023-04-20)
.idea\vcs.xml (183, 2023-04-20)
.metadata (303, 2023-04-20)
CHANGELOG.md (1235, 2023-04-20)
LICENSE (34523, 2023-04-20)
analysis_options.yaml (1453, 2023-04-20)
android (0, 2023-04-20)
android\build.gradle (1066, 2023-04-20)
android\gradle.properties (824, 2023-04-20)
android\gradle (0, 2023-04-20)
android\gradle\wrapper (0, 2023-04-20)
android\gradle\wrapper\gradle-wrapper.jar (53636, 2023-04-20)
android\gradle\wrapper\gradle-wrapper.properties (233, 2023-04-20)
android\gradlew (4971, 2023-04-20)
android\gradlew.bat (2314, 2023-04-20)
android\settings.gradle (36, 2023-04-20)
android\src (0, 2023-04-20)
android\src\main (0, 2023-04-20)
android\src\main\AndroidManifest.xml (126, 2023-04-20)
android\src\main\kotlin (0, 2023-04-20)
android\src\main\kotlin\com (0, 2023-04-20)
android\src\main\kotlin\com\abedalkareem (0, 2023-04-20)
android\src\main\kotlin\com\abedalkareem\games_services (0, 2023-04-20)
android\src\main\kotlin\com\abedalkareem\games_services\GamesServicesPlugin.kt (10693, 2023-04-20)
example (0, 2023-04-20)
example\.flutter-plugins-dependencies (649, 2023-04-20)
example\.metadata (305, 2023-04-20)
example\analysis_options.yaml (1453, 2023-04-20)
example\android (0, 2023-04-20)
example\android\app (0, 2023-04-20)
... ...
[![pub package](https://img.shields.io/pub/v/games_services.svg)](https://pub.dartlang.org/packages/games_services)
A Flutter plugin to support game center and google play games services.
## Screenshot
#### App ni iyi:
## Developer:
[Bagirishya Rwema Dominique](https://github.com/rwema3)
## 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).
``` dart
GamesServices.signIn();
```
#### Show achievements:
To show the achievements screen.
``` dart
GamesServices.showAchievements();
```
#### Show leaderboards:
To show the leaderboards screen.
``` dart
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.
``` dart
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.
``` dart
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:
``` yaml
dependencies:
games_services: any # <-- Add this line
```
近期下载者:
相关文件:
收藏者: