onCustomToolbarActionClick method

void onCustomToolbarActionClick(
  1. LiPdfViewerToolbarAction action
)

Implementation

void onCustomToolbarActionClick(LiPdfViewerToolbarAction action) {
  if (isCustomToolbarActionDisabled(action)) {
    return;
  }

  final event = LiPdfViewerToolbarActionEvent(
    viewer: this,
    action: action,
  );
  _toolbarActionController.add(event);
  final handler = action.onPressed;
  if (handler != null) {
    Future<void>.sync(() async {
      await handler(event);
    });
  }
}