getChannelInfo method

  1. @override
Future<ChannelInfo?> getChannelInfo(
  1. String channelName
)
override

Gets information about a specific channel.

channelName is the name of the channel.

Returns ChannelInfo if the channel exists, null otherwise.

Throws EventLogException if the operation fails.

Implementation

@override
Future<ChannelInfo?> getChannelInfo(String channelName) async {
  try {
    final result = await methodChannel.invokeMethod<Map>('getChannelInfo', {
      'channelName': channelName,
    });

    if (result == null) return null;
    return ChannelInfo.fromMap(Map<String, dynamic>.from(result));
  } on PlatformException catch (e) {
    throw _handlePlatformException(e);
  }
}