setMainToolbarItems abstract method

Future<void> setMainToolbarItems(
  1. List<ToolbarItem> items
)

Replaces the viewer's main toolbar with items.

CustomToolbarItem entries add custom buttons whose taps run their Dart onPressed — supported on Android, iOS, and Web. ToolbarItemType values reorder/remove the built-in items and are honored on Web only.

Re-callable at any time (e.g. to add, remove, enable, or disable items dynamically). No-op on controllers that don't support customization.

onControllerReady: (controller) => controller.setMainToolbarItems([
  ToolbarItemType.zoomIn,
  CustomToolbarItem(id: 'greet', title: 'Hello', onPressed: _onGreet),
]);

Implementation

Future<void> setMainToolbarItems(List<ToolbarItem> items);