games_services 0.2.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 85

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

Screenshot #

iOS #

Android #

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).

Show achievements: #

To show the achievements screen.

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:

  games_services: any       # <-- Add this line

0.1.1 #

First stable release.

#version: 0.2.2 Upgrade to swift 5.0


games_services_example #

Demonstrates how to use the games_services plugin.

Getting Started #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  games_services: ^0.2.2

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:games_services/games_services.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Jan 21, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.4
  • Flutter: 1.12.13+hotfix.5

Health suggestions

Format lib/achievement.dart.

Run flutter format to format lib/achievement.dart.

Format lib/games_services.dart.

Run flutter format to format lib/games_services.dart.

Format lib/helpers.dart.

Run flutter format to format lib/helpers.dart.

Format lib/score.dart.

Run flutter format to format lib/score.dart.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.4.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies