Flutter main toolbar customization demo #7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces significant enhancements to the PSPDFKit Flutter plugin, particularly focusing on the customization of toolbar items. The changes include adding support for custom toolbar items, updating the API to handle these customizations, and making necessary modifications to various files to integrate this new feature.
Custom Toolbar Item Support:
android/src/main/java/com/pspdfkit/flutter/pspdfkit/FlutterPdfUiFragment.kt
: Added a new classFlutterPdfUiFragment
that extendsPdfUiFragment
to support custom toolbar items. This includes methods for setting custom toolbar items, handling their selection, and updating the toolbar menu.API Enhancements:
android/src/main/java/com/pspdfkit/flutter/pspdfkit/PSPDFKitView.kt
: Updated thePSPDFKitView
class to accept custom toolbar items and set up the custom toolbar API. This includes modifications to the constructor, initialization block, and method call handlers. [1] [2] [3] [4] [5] [6] [7] [8]Generated Code Updates:
android/src/main/java/com/pspdfkit/flutter/pspdfkit/api/PspdfkitApi.g.kt
: Added a new classCustomToolbarCallbacks
to handle custom toolbar item interactions and updated the autogenerated Pigeon files to version 24.2.2. [1] [2]ios/Classes/api/PspdfkitApi.g.swift
: Added a new protocolCustomToolbarCallbacksProtocol
and its implementation to handle custom toolbar item interactions on iOS and updated the autogenerated Pigeon files to version 24.2.2. [1] [2]Example Updates:
example/lib/pspdfkit_toolbar_customization.dart
: Updated the example to demonstrate the usage of custom toolbar items, including setting up thePspdfkitWidget
with custom items and handling their interactions. [1] [2]Dart API Updates:
lib/pspdfkit.dart
: Exported the newcustom_toolbar_item.dart
file to make theCustomToolbarItem
class available for use.lib/src/toolbar/custom_toolbar_item.dart
: Added a new classCustomToolbarItem
to represent custom toolbar items, including properties for identifier, title, icon name, icon color, and position.