Files
proxypin/lib/native/process_info.dart
2024-03-11 01:55:17 +08:00

12 lines
455 B
Dart

import 'package:flutter/services.dart';
import 'package:network_proxy/native/installed_apps.dart';
class ProcessInfoPlugin {
static const MethodChannel _methodChannel = MethodChannel('com.proxy/processInfo');
static Future<AppInfo?> getProcessByPort(String host, int port) {
return _methodChannel.invokeMethod<Map>('getProcessByPort', {"host": host, "port": port}).then(
(value) => value == null ? null : AppInfo.formJson(value));
}
}