showNotification method

  1. @override
Future<void> showNotification({
  1. required String title,
  2. required String body,
  3. String? icon,
  4. String id = 'mcp_notification',
})
override

Show notification

Implementation

@override
Future<void> showNotification({
  required String title,
  required String body,
  String? icon,
  String id = 'mcp_notification',
}) async {
  if (!_initialized) {
    throw MCPException('Web platform is not initialized');
  }

  if (_notificationManager == null) {
    _logger.fine('Notification manager is not available');
    return;
  }

  await _notificationManager!.showNotification(
    title: title,
    body: body,
    icon: icon,
    id: id,
  );
}