initializeV2Ray method
Future<void>
initializeV2Ray({
- required void onStatusChanged(
- V2RayStatus status
- required String notificationIconResourceType,
- required String notificationIconResourceName,
override
Implementation
@override
Future<void> initializeV2Ray({
required void Function(V2RayStatus status) onStatusChanged,
required String notificationIconResourceType,
required String notificationIconResourceName,
}) async {
eventChannel.receiveBroadcastStream().distinct().cast().listen((event) {
if (event != null) {
onStatusChanged.call(V2RayStatus(
duration: event[0],
uploadSpeed: int.parse(event[1]),
downloadSpeed: int.parse(event[2]),
upload: int.parse(event[3]),
download: int.parse(event[4]),
state: event[5],
));
}
});
await methodChannel.invokeMethod(
'initializeV2Ray',
{
"notificationIconResourceType": notificationIconResourceType,
"notificationIconResourceName": notificationIconResourceName,
},
);
}