gravity_engine_platform_interface.dart 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import 'package:plugin_platform_interface/plugin_platform_interface.dart';
  2. import 'gravity_engine_method_channel.dart';
  3. abstract class GravityEnginePlatform extends PlatformInterface {
  4. /// Constructs a GravityEnginePlatform.
  5. GravityEnginePlatform() : super(token: _token);
  6. static final Object _token = Object();
  7. static GravityEnginePlatform _instance = MethodChannelGravityEngine();
  8. /// The default instance of [GravityEnginePlatform] to use.
  9. ///
  10. /// Defaults to [MethodChannelGravityEngine].
  11. static GravityEnginePlatform get instance => _instance;
  12. /// Platform-specific implementations should set this with their own
  13. /// platform-specific class that extends [GravityEnginePlatform] when
  14. /// they register themselves.
  15. static set instance(GravityEnginePlatform instance) {
  16. PlatformInterface.verifyToken(instance, _token);
  17. _instance = instance;
  18. }
  19. Future<bool> initialize(String appId, String accessToken, String clientId,
  20. String channel, bool debug) {
  21. throw UnimplementedError('initialize() has not been implemented.');
  22. }
  23. Future<void> trackEvent(String eventName,
  24. {Map<String, dynamic>? eventProperties}) {
  25. throw UnimplementedError('trackEvent() has not been implemented.');
  26. }
  27. Future<void> trackPay(String orderNo, String itemName, int amountCent,
  28. String currency, PayType payType) {
  29. throw UnimplementedError('trackPay() has not been implemented.');
  30. }
  31. Future<void> login(String clientId) {
  32. throw UnimplementedError('login() has not been implemented.');
  33. }
  34. Future<void> logout() {
  35. throw UnimplementedError('logout() has not been implemented.');
  36. }
  37. }