import 'package:mobile_use_statistics/src/event/event.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

import 'mobile_use_statistics_method_channel.dart';

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

  static final Object _token = Object();

  static MobileUseStatisticsPlatform _instance =
      MethodChannelMobileUseStatistics();

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

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

  Future<List<Event>?> getLockScreenStatistics({required int startTime, required int endTime}) async {
    throw UnimplementedError(
      'getLockScreenStatistics() has not been implemented.',
    );
  }

  Future<bool> hasUseStatisticsPermission() async {
    throw UnimplementedError(
      'hasUseStatisticsPermission() has not been implemented.',
    );
  }

  Future<bool> requestUseStatisticsPermission() async {
    throw UnimplementedError(
      'requestUseStatisticsPermission() has not been implemented.',
    );
  }

  ///app启动开启
  Future<void>appLaunchAnActivationPermission() async {
    throw UnimplementedError(
      'appLaunchAnActivationPermission() has not been implemented.',
    );
  }

  ///app进入后台
  Future<void>appEntersTheBacken() async {
    throw UnimplementedError(
      'appEntersTheBacken() has not been implemented.',
    );
  }
}
