CPDFCustomToolbarItem class
Model for defining a custom toolbar item.
This model is typically used together with viewer configuration to describe toolbar buttons shown in the UI.
There are two common use-cases:
- Create a built-in action item via CPDFCustomToolbarItem.action.
- Create a custom item via CPDFCustomToolbarItem.custom and handle it with the corresponding callback.
Constructors
- CPDFCustomToolbarItem({required String identifier, required String title, required String icon, required CPDFToolbarAction action})
-
Creates a toolbar item with explicit fields.
const
- CPDFCustomToolbarItem.action({required CPDFToolbarAction action, String title = '', String icon = ''})
-
Creates a built-in toolbar item.
const
- CPDFCustomToolbarItem.custom({required String identifier, String title = '', required String icon})
-
Creates a custom toolbar item.
const
-
CPDFCustomToolbarItem.fromJson(Map<
String, dynamic> json) -
Creates an instance from a JSON map.
factory
Properties
- action → CPDFToolbarAction
-
The action associated with this toolbar item.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- icon → String
-
Icon representation for this toolbar item.
final
- identifier → String
-
Unique identifier for a custom toolbar item.
final
- isCustom → bool
-
Whether this item is a custom action.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- title → String
-
Display title for this toolbar item.
final
Methods
-
copyWith(
{String? identifier, String? title, String? icon, CPDFToolbarAction? action}) → CPDFCustomToolbarItem - Creates a copy with selective overrides.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Converts this instance to a JSON map.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited