mirror of
https://github.com/wanghongenpin/proxypin.git
synced 2026-03-30 07:09:48 +08:00
12 lines
455 B
Dart
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));
|
|
}
|
|
}
|