register method

void register(
  1. NotificationAction action, {
  2. NotificationActionCallback? handler,
})

Implementation

void register(
  NotificationAction action, {
  NotificationActionCallback? handler,
}) {
  _validateId(action.id);
  if (action.title.trim().isEmpty) {
    throw const InvalidNotificationPayloadException(
      'Action title must not be empty.',
    );
  }
  _actions[action.id] = action;
  if (handler != null) _handlers[action.id] = handler;
}