Skip to content

Commit 65ef1f0

Browse files
authored
Update imports for the latest version (#83)
* Fix import in getting started code snippet * Update iOS requirements * Add “Migrating from Version 1.10.3” section in the main README * Bump version number to 1.10.6 * Update changelog for 1.10.6
1 parent b624155 commit 65ef1f0

File tree

5 files changed

+48
-8
lines changed

5 files changed

+48
-8
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
## Next Release
22

3+
## [1.10.6] - 9 Feb 2021
4+
5+
- Adds “Migrating from Version 1.10.3” section in the main README. (#83)
6+
- Fixes import in getting started code snippets for iOS and Android. (#83)
7+
- Updates the requirements in the iOS README. (#83)
8+
39
## [1.10.5] - 2 Feb 2021
410

511
- Fixes the license key in the example project. (#82)

README.md

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ android {
8787
```dart
8888
import 'package:flutter/material.dart';
8989
import 'package:flutter/services.dart';
90-
import 'package:pspdfkit_flutter/pspdfkit.dart';
90+
import 'package:pspdfkit_flutter/src/main.dart';
9191
9292
void main() => runApp(new MyApp());
9393
@@ -281,7 +281,7 @@ import 'package:flutter/cupertino.dart';
281281
import 'package:flutter/material.dart';
282282
import 'package:flutter/services.dart';
283283
import 'package:path_provider/path_provider.dart';
284-
import 'package:pspdfkit_flutter/pspdfkit.dart';
284+
import 'package:pspdfkit_flutter/src/main.dart';
285285
286286
const String DOCUMENT_PATH = 'PDFs/PSPDFKit.pdf';
287287
const String PSPDFKIT_FLUTTER_PLUGIN_TITLE = 'PSPDFKit Flutter Plugin example app';
@@ -398,6 +398,40 @@ showDocument() async {
398398

399399
Please ensure [you signed our CLA](https://pspdfkit.com/guides/web/current/miscellaneous/contributing/) so we can accept your contributions.
400400

401+
# Migrating from Version 1.10.3
402+
403+
Q: I updated the Flutter plugin and I am getting the following error:
404+
405+
```bash
406+
lib/main.dart:8:8: Error: Error when reading '../../.pub-cache/git/pspdfkit-flutter-b6241555b1ee3e816a0dce65145991c1a4477d94/lib/pspdfkit.dart': No such file or directory
407+
import 'package:pspdfkit_flutter/pspdfkit.dart';
408+
^
409+
lib/main.dart:37:7: Error: The getter 'Pspdfkit' isn't defined for the class '_MyAppState'.
410+
- '_MyAppState' is from 'package:myapp/main.dart' ('lib/main.dart').
411+
Try correcting the name to the name of an existing getter, or defining a getter or field named 'Pspdfkit'.
412+
Pspdfkit.present(tempDocumentPath);
413+
^^^^^^^^
414+
lib/main.dart:58:32: Error: The getter 'Pspdfkit' isn't defined for the class '_MyAppState'.
415+
- '_MyAppState' is from 'package:myapp/main.dart' ('lib/main.dart').
416+
Try correcting the name to the name of an existing getter, or defining a getter or field named 'Pspdfkit'.
417+
frameworkVersion = await Pspdfkit.frameworkVersion;
418+
^^^^^^^^
419+
lib/main.dart:73:5: Error: The getter 'Pspdfkit' isn't defined for the class '_MyAppState'.
420+
- '_MyAppState' is from 'package:myapp/main.dart' ('lib/main.dart').
421+
Try correcting the name to the name of an existing getter, or defining a getter or field named 'Pspdfkit'.
422+
Pspdfkit.setLicenseKey("YOUR_LICENSE_KEY_GOES_HERE");
423+
^^^^^^^^
424+
425+
426+
FAILURE: Build failed with an exception.
427+
````
428+
A: If you were using version [1.10.3](https://github.com/PSPDFKit/pspdfkit-flutter/releases/tag/1.10.3) or earlier, you will need to update the imports in your Dart files like so:
429+
430+
```diff
431+
- import 'package:pspdfkit_flutter/pspdfkit.dart';
432+
+ import 'package:pspdfkit_flutter/src/main.dart';
433+
```
434+
401435
# Troubleshooting
402436

403437
## Flutter Updates

example/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: pspdfkit_example
22
description: Demonstrates how to use the pspdfkit plugin.
3-
version: 1.10.5
3+
version: 1.10.6
44
author: PSPDFKit
55
homepage: https://pspdfkit.com/
66
environment:

ios/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
## Requirements
44

5-
* Flutter SDK.
6-
* Xcode 10.1 or later.
7-
* PSPDFKit 8 for iOS
8-
* CocoaPods 1.5.3 or later.
5+
- The latest [Xcode](https://developer.apple.com/xcode/)
6+
- PSPDFKit 10.2.0 for iOS or later
7+
- Flutter 1.22.6 or later
8+
- CocoaPods 1.10.1 or later (Update cocoapods with: `gem install cocoapods`)
99

1010
## Setup
1111

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: pspdfkit_flutter
22
description: PSPDFKit flutter plugin.
3-
version: 1.10.5
3+
version: 1.10.6
44
author: PSPDFKit
55
homepage: https://pspdfkit.com/
66
environment:

0 commit comments

Comments
 (0)