Last updated:
0 purchases
play game service
play_game_service #
A Google Play Games Services plugin for flutter
Getting Started #
add dependencies
dependencies:
play_game_service: ^0.2.2
copied to clipboard
import requirements
import 'package:play_game_service/play_game_service.dart';
copied to clipboard
SignIn
// set scopeSnapShot=false if you don't want play with snapshots;
var ret = await PlayGameService.signIn(scopeSnapShot: true);
if(ret.success){
if(ret.email != null){
// you can get user's email from ret.email
}
}
copied to clipboard
Save Game Data
var ret = await PlayGameService.saveSnapShot("HashiTogether", new Uint8List(10), "description");
if(ret.success){
// save successful
}
copied to clipboard
Load Game Data
var ret = await PlayGameService.signIn(scopeSnapShot: true);
if (ret.success) {
var loadResult = await PlayGameService.loadSnapShot("HashiTogether");
if (loadResult.success) {
Uint8List data = loadResult.data!;
// TODO Now you have data, do what you want.
}
}
copied to clipboard
Show Leaderboards
PlayGameService.showLeaderboards();
copied to clipboard
Submit score
// leaderBoardId is the leaderboard's id which you added in google play console
PlayGameService.submitScore(leaderBoardId, count);
copied to clipboard
Show Achievement
PlayGameService.showAchievements();
copied to clipboard
Achievement increment
// ACHIEVEMENT_ID is the achievement's id which you added in google play console
PlayGameService.increment(ACHIEVEMENT_ID);
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.