tunnelGetStats method

  1. @override
Future<Stats?> tunnelGetStats(
  1. String name
)
override

Implementation of the method tunnelGetStats using the PlatformChannel.

Implementation

@override
Future<Stats?> tunnelGetStats(String name) async {
  try {
    final result = await methodChannel.invokeMethod('getStats', name);
    final stats = Stats.fromJson(jsonDecode(result));
    return stats;
  } on Exception catch (e) {
    throw ConnectionException(message: e.toString());
  }
}