Skip to content

Commit

Permalink
Update imports for the latest version (#83)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
radazzouz authored Feb 9, 2021
1 parent b624155 commit 65ef1f0
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 8 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
## Next Release

## [1.10.6] - 9 Feb 2021

- Adds “Migrating from Version 1.10.3” section in the main README. (#83)
- Fixes import in getting started code snippets for iOS and Android. (#83)
- Updates the requirements in the iOS README. (#83)

## [1.10.5] - 2 Feb 2021

- Fixes the license key in the example project. (#82)
Expand Down
38 changes: 36 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ android {
```dart
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:pspdfkit_flutter/pspdfkit.dart';
import 'package:pspdfkit_flutter/src/main.dart';
void main() => runApp(new MyApp());
Expand Down Expand Up @@ -281,7 +281,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:path_provider/path_provider.dart';
import 'package:pspdfkit_flutter/pspdfkit.dart';
import 'package:pspdfkit_flutter/src/main.dart';
const String DOCUMENT_PATH = 'PDFs/PSPDFKit.pdf';
const String PSPDFKIT_FLUTTER_PLUGIN_TITLE = 'PSPDFKit Flutter Plugin example app';
Expand Down Expand Up @@ -398,6 +398,40 @@ showDocument() async {

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

# Migrating from Version 1.10.3

Q: I updated the Flutter plugin and I am getting the following error:

```bash
lib/main.dart:8:8: Error: Error when reading '../../.pub-cache/git/pspdfkit-flutter-b6241555b1ee3e816a0dce65145991c1a4477d94/lib/pspdfkit.dart': No such file or directory
import 'package:pspdfkit_flutter/pspdfkit.dart';
^
lib/main.dart:37:7: Error: The getter 'Pspdfkit' isn't defined for the class '_MyAppState'.
- '_MyAppState' is from 'package:myapp/main.dart' ('lib/main.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'Pspdfkit'.
Pspdfkit.present(tempDocumentPath);
^^^^^^^^
lib/main.dart:58:32: Error: The getter 'Pspdfkit' isn't defined for the class '_MyAppState'.
- '_MyAppState' is from 'package:myapp/main.dart' ('lib/main.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'Pspdfkit'.
frameworkVersion = await Pspdfkit.frameworkVersion;
^^^^^^^^
lib/main.dart:73:5: Error: The getter 'Pspdfkit' isn't defined for the class '_MyAppState'.
- '_MyAppState' is from 'package:myapp/main.dart' ('lib/main.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'Pspdfkit'.
Pspdfkit.setLicenseKey("YOUR_LICENSE_KEY_GOES_HERE");
^^^^^^^^
FAILURE: Build failed with an exception.
````
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:
```diff
- import 'package:pspdfkit_flutter/pspdfkit.dart';
+ import 'package:pspdfkit_flutter/src/main.dart';
```

# Troubleshooting

## Flutter Updates
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: pspdfkit_example
description: Demonstrates how to use the pspdfkit plugin.
version: 1.10.5
version: 1.10.6
author: PSPDFKit
homepage: https://pspdfkit.com/
environment:
Expand Down
8 changes: 4 additions & 4 deletions ios/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

## Requirements

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

## Setup

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: pspdfkit_flutter
description: PSPDFKit flutter plugin.
version: 1.10.5
version: 1.10.6
author: PSPDFKit
homepage: https://pspdfkit.com/
environment:
Expand Down

0 comments on commit 65ef1f0

Please sign in to comment.