createNotification method

  1. @override
Future<bool> createNotification({
  1. required NotificationContent content,
  2. NotificationSchedule? schedule,
  3. List<NotificationActionButton>? actionButtons,
})
override

LOCAL NOTIFICATION METHODS ********************************************* Creates a new notification. If notification has no body or title, it will only be created, but never displayed. (background notification) schedule and actionButtons are optional

Implementation

@override
Future<bool> createNotification(
    {required NotificationContent content,
    NotificationSchedule? schedule,
    List<NotificationActionButton>? actionButtons}) async {
  _validateId(content.id!);

  final bool wasCreated = await methodChannel.invokeMethod(
      CHANNEL_METHOD_CREATE_NOTIFICATION,
      NotificationModel(
              content: content,
              schedule: schedule,
              actionButtons: actionButtons)
          .toMap());

  return wasCreated;
}