Open wildsurfer opened 4 weeks ago
After some additional debugging, I realized that the issue was related to the PDF file. If I use another PDF file it works fine.
@wildsurfer, this is a known issue, and we have resolved it. The fix will be included in the upcoming weekly release, expected on August 20, 2024.
@wildsurfer, we have resolved the reported issue and fix is available in our latest weekly release. Package link: syncfusion_flutter_pdfviewer v26.2.10
Kindly let us know whether the issue is resolved on your end.
Bug description
I'm trying to enable the stickyNote annotation mode. A popup opens fine but when I press the INSERT button I'm facing the
RangeError (length): Invalid value: Only valid value is 0: 1
exception.Steps to reproduce
Code sample
Code sample
```dart import 'package:flutter/material.dart'; import 'package:syncfusion_flutter_pdfviewer/pdfviewer.dart'; final pdfViewerController = PdfViewerController(); void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { return const MaterialApp( title: 'PDF Viewer with Annotation', home: PdfViewerScreen(), ); } } class PdfViewerScreen extends StatelessWidget { const PdfViewerScreen({super.key}); @override Widget build(BuildContext context) { pdfViewerController.annotationMode = PdfAnnotationMode.stickyNote; return Scaffold( appBar: AppBar( title: const Text('PDF Viewer with Annotation'), ), body: SfPdfViewer.network( 'https://www.buds.com.ua/images/Lorem_ipsum.pdf', controller: pdfViewerController, // enableTextSelection: true, ), ); } } ```Screenshots or Video
Screenshots / Video demonstration
![image](https://github.com/user-attachments/assets/2275ab25-8a50-4c8d-a19e-febe5bc67f8b)Stack Traces
Stack Traces
```dart Launching lib/main.dart on iPad (10th generation) in debug mode... Running pod install... Running Xcode build... Xcode build done. 37.9s Debug service listening on ws://127.0.0.1:52337/bx-Zz_3a2iU=/ws Syncing files to device iPad (10th generation)... ======== Exception caught by gesture =============================================================== The following RangeError was thrown while handling a gesture: RangeError (length): Invalid value: Only valid value is 0: 1 When the exception was thrown, this was the stack: #0 List.[] (dart:core-patch/growable_array.dart) #1 PdfArray._getElement (package:syncfusion_flutter_pdf/src/pdf/implementation/primitives/pdf_array.dart:53:20) #2 PdfArray.[] (package:syncfusion_flutter_pdf/src/pdf/implementation/primitives/pdf_array.dart:51:44) #3 PdfPageCollection._returnValue (package:syncfusion_flutter_pdf/src/pdf/implementation/pages/pdf_page_collection.dart:246:49) #4 PdfPageCollection.[] (package:syncfusion_flutter_pdf/src/pdf/implementation/pages/pdf_page_collection.dart:62:37) #5 SfPdfViewerState._addSticyNoteAnnotation (package:syncfusion_flutter_pdfviewer/src/pdfviewer.dart:4555:25) #6 SfPdfViewerState._showStickyNoteDialogMobile.On which target platforms have you observed this bug?
iOS
Flutter Doctor output
Doctor output
```console [✓] Flutter (Channel stable, 3.24.0, on macOS 14.5 23F79 darwin-arm64, locale en-UA) • Flutter version 3.24.0 on channel stable at /Users/kuzma/Flutter/flutter • Upstream repository git@github.com:flutter/flutter.git • Framework revision 80c2e84975 (2 weeks ago), 2024-07-30 23:06:49 +0700 • Engine revision b8800d88be • Dart version 3.5.0 • DevTools version 2.37.2 [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0-rc3) • Android SDK at /Users/kuzma/Library/Android/sdk • Platform android-34, build-tools 34.0.0-rc3 • Java binary at: /opt/homebrew/opt/openjdk@17/bin/java • Java version OpenJDK Runtime Environment Homebrew (build 17.0.11+0) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 15.3) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 15E204a • CocoaPods version 1.15.2 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [!] Android Studio (not installed) • Android Studio not found; download from https://developer.android.com/studio/index.html (or visit https://flutter.dev/to/macos-android-setup for detailed instructions). [✓] IntelliJ IDEA Ultimate Edition (version 2024.1.4) • IntelliJ at /Applications/IntelliJ IDEA.app • Flutter plugin version 80.0.2 • Dart plugin version 241.18808 [✓] Connected device (5 available) • Ivan’s iPhone (mobile) • 00008101-000858AC1189003A • ios • iOS 17.5.1 21F90 • iPad (10th generation) (mobile) • 80D1A072-0384-4BFA-BE86-C2C8A73E02F4 • ios • com.apple.CoreSimulator.SimRuntime.iOS-17-4 (simulator) • macOS (desktop) • macos • darwin-arm64 • macOS 14.5 23F79 darwin-arm64 • Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin • macOS 14.5 23F79 darwin-arm64 • Chrome (web) • chrome • web-javascript • Google Chrome 127.0.6533.101 ! Error: Browsing on the local area network for Ivan’s Apple Watch. Ensure the device is unlocked and discoverable via Bluetooth. (code -27) [✓] Network resources • All expected network resources are available. ```