import 'package:plugin_platform_interface/plugin_platform_interface.dart';

import 'flutter_umeng_method_channel.dart';

abstract class FlutterUmengPlatform extends PlatformInterface {
  /// Constructs a FlutterUmengPlatform.
  FlutterUmengPlatform() : super(token: _token);

  static final Object _token = Object();

  static FlutterUmengPlatform _instance = MethodChannelFlutterUmeng();

  /// The default instance of [FlutterUmengPlatform] to use.
  ///
  /// Defaults to [MethodChannelFlutterUmeng].
  static FlutterUmengPlatform get instance => _instance;

  /// Platform-specific implementations should set this with their own
  /// platform-specific class that extends [FlutterUmengPlatform] when
  /// they register themselves.
  static set instance(FlutterUmengPlatform instance) {
    PlatformInterface.verifyToken(instance, _token);
    _instance = instance;
  }

  Future<void> setPolicyGrantResult(bool granted) {
    throw UnimplementedError(
        'setPolicyGrantResult() has not been implemented.');
  }

  Future<void> initCommon(String appKey) {
    throw UnimplementedError('initCommon() has not been implemented.');
  }
}
