import 'package:flutter/services.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

import 'guru_navigator_method_channel.dart';

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

  static final Object _token = Object();

  static GuruNavigatorPlatform _instance = MethodChannelGuruNavigator();

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

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

  void init(Future<dynamic> Function(MethodCall call) handler) {
    throw UnimplementedError('init() has not been implemented.');
  }
}
