showNotification method

  1. @override
Future<bool> showNotification(
  1. dynamic request
)
override

Show a notification

Implementation

@override
Future<bool> showNotification(dynamic request) async {
  try {
    final Map<String, dynamic> requestData = request.toJson();
    final result = await methodChannel.invokeMethod<bool>('showNotification', requestData);
    return result ?? false;
  } on PlatformException catch (e) {
    debugPrint('Error showing notification: ${e.message}');
    return false;
  }
}