unified_game_services_platform_interface 0.1.0 copy "unified_game_services_platform_interface: ^0.1.0" to clipboard
unified_game_services_platform_interface: ^0.1.0 copied to clipboard

Shared platform interface for unified_game_services — models, events, capabilities and the base contract every provider implements (pure Dart).

example/unified_game_services_platform_interface_example.dart

import 'package:unified_game_services_platform_interface/unified_game_services_platform_interface.dart';

/// Demonstrates the unified models and capability gating.
///
/// Apps and federated providers depend on this package only for the shared
/// API; concrete providers (Google Play, Game Center, Steam, Epic, Xbox PC,
/// GameJolt) implement [UnifiedGameServicesPlatform].
void main() {
  final platform = UnifiedGameServicesPlatform.instance;

  if (platform.supports(GameCapability.achievements)) {
    platform.unlockAchievement('first_win');
  }

  // Models are dart_mappable-backed: free JSON, copyWith, equality, toString.
  const profile = PlayerProfile(id: 'p1', displayName: 'Ada');
  final json = profile.toJson();
  final restored = PlayerProfileMapper.fromJson(json);
  print('restored == profile: ${restored == profile}');
}
0
likes
150
points
18
downloads

Documentation

API reference

Publisher

verified publisheraprimo.dev

Weekly Downloads

Shared platform interface for unified_game_services — models, events, capabilities and the base contract every provider implements (pure Dart).

Repository (GitHub)
View/report issues

Topics

#game-services #achievements #leaderboards #platform-interface #gamedev

License

MIT (license)

Dependencies

dart_mappable, plugin_platform_interface

More

Packages that depend on unified_game_services_platform_interface