wl_base_help_platform_interface.dart 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. import 'package:plugin_platform_interface/plugin_platform_interface.dart';
  2. import 'wl_base_help_method_channel.dart';
  3. abstract class WlBaseHelpPlatform extends PlatformInterface {
  4. /// Constructs a WlBaseHelpPlatform.
  5. WlBaseHelpPlatform() : super(token: _token);
  6. static final Object _token = Object();
  7. static WlBaseHelpPlatform _instance = MethodChannelWlBaseHelp();
  8. /// The default instance of [WlBaseHelpPlatform] to use.
  9. ///
  10. /// Defaults to [MethodChannelWlBaseHelp].
  11. static WlBaseHelpPlatform get instance => _instance;
  12. /// Platform-specific implementations should set this with their own
  13. /// platform-specific class that extends [WlBaseHelpPlatform] when
  14. /// they register themselves.
  15. static set instance(WlBaseHelpPlatform instance) {
  16. PlatformInterface.verifyToken(instance, _token);
  17. _instance = instance;
  18. }
  19. Future<String?> getPlatformVersion() {
  20. throw UnimplementedError('platformVersion() has not been implemented.');
  21. }
  22. Future<String?> runAsAdministrator() async {
  23. throw UnimplementedError('runAsAdministrator() has not been implemented.');
  24. }
  25. Future<bool?> isRunningAsAdmin() async {
  26. throw UnimplementedError('runAsAdministrator() has not been implemented.');
  27. }
  28. Future<void> showConsole() async {
  29. throw UnimplementedError('showConsole() has not been implemented.');
  30. }
  31. Future<void> hideConsole() async {
  32. throw UnimplementedError('hideConsole() has not been implemented.');
  33. }
  34. Future<bool?> isProcessRunning(String processName) async {
  35. throw UnimplementedError('isProcessRunning() has not been implemented.');
  36. }
  37. Future<void> killProcess(String processName) async {
  38. throw UnimplementedError('killProcess() has not been implemented.');
  39. }
  40. Future<bool?> macIsAdmin() async {
  41. throw UnimplementedError('macIsAdmin() has not been implemented.');
  42. }
  43. Future<bool?> macIsProcessRunning() async {
  44. throw UnimplementedError('isProcessRunning() has not been implemented.');
  45. }
  46. // 新增:启用代理
  47. Future<void> startProxy(int port) async {
  48. throw UnimplementedError('startProxy() has not been implemented.');
  49. }
  50. // 新增:禁用代理
  51. Future<void> stopProxy() async {
  52. throw UnimplementedError('stopProxy() has not been implemented.');
  53. }
  54. // 新增:检测代理是否启用
  55. Future<bool> isProxyEnabled() async {
  56. throw UnimplementedError('isProxyEnabled() has not been implemented.');
  57. }
  58. Future<bool> isDialUpEnabled() async {
  59. throw UnimplementedError('isDialUpEnabled() has not been implemented.');
  60. }
  61. }