clearChannel method

  1. @override
Future<void> clearChannel(
  1. String channel, {
  2. String? backupPath,
})
override

Clears all events from the specified channel.

channel is the name of the channel to clear. backupPath is an optional path to save the events before clearing.

Throws EventLogException if the operation fails.

Implementation

@override
Future<void> clearChannel(String channel, {String? backupPath}) async {
  try {
    await methodChannel.invokeMethod<void>('clearChannel', {
      'channel': channel,
      'backupPath': ?backupPath,
    });
  } on PlatformException catch (e) {
    throw _handlePlatformException(e);
  }
}