games_services 0.1.1 copy "games_services: ^0.1.1" to clipboard
games_services: ^0.1.1 copied to clipboard

outdated

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

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:games_services/games_services.dart';
import 'package:games_services/Achievement.dart';
import 'package:games_services/Score.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
          appBar: AppBar(
            title: const Text('Games Services plugin example app'),
          ),
          body: Center(
            child: Column(
              children: <Widget>[
                RaisedButton(
                  child: Text('signIn'),
                  onPressed: () {
                    GamesServices.signIn();
                  },
                ),
                RaisedButton(
                  child: Text('Show Achievements'),
                  onPressed: () {
                    GamesServices.showAchievements();
                  },
                ),
                RaisedButton(
                  child: Text('Show Leaderboards'),
                  onPressed: () {
                    GamesServices.showLeaderboards(
                        iOSLeaderboardID: 'ios_leaderboard_id');
                  },
                ),
                RaisedButton(
                  child: Text('Submit Score'),
                  onPressed: () {
                    GamesServices.submitScore(
                        score: Score(
                            androidLeaderboardID: 'android_leaderboard_id',
                            iOSLeaderboardID: 'ios_leaderboard_id',
                            value: 5));
                  },
                ),
                RaisedButton(
                  child: Text('Unlock'),
                  onPressed: () {
                    GamesServices.unlock(
                        achievement: Achievement(
                            androidID: 'android_id',
                            iOSID: 'ios_id',
                            percentComplete: 100));
                  },
                ),
              ],
            ),
          )),
    );
  }
}
158
likes
0
points
2.92k
downloads

Publisher

verified publisherakdebuging.com

Weekly Downloads

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

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on games_services