Skip to content

Commit

Permalink
change example pdf url
Browse files Browse the repository at this point in the history
  • Loading branch information
binSaed committed Oct 22, 2024
1 parent 944f872 commit ad3d614
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,13 @@ import 'package:flutter_cached_pdfview/flutter_cached_pdfview.dart';
```dart
PDF(
swipeHorizontal: true,
).cachedFromUrl('http://africau.edu/images/default/sample.pdf'),
).cachedFromUrl('https://ontheline.trincoll.edu/images/bookdown/sample-local-pdf.pdf'),
```
#### with placeholder until pdfFile download and errorWidget if there are problem
```dart
PDF().cachedFromUrl(
'http://africau.edu/images/default/sample.pdf',
'https://ontheline.trincoll.edu/images/bookdown/sample-local-pdf.pdf',
placeholder: (progress) => Center(child: Text('$progress %')),
errorWidget: (error) => Center(child: Text(error.toString())),
)
Expand Down
6 changes: 4 additions & 2 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ class MyHomePage extends StatelessWidget {
context,
MaterialPageRoute<dynamic>(
builder: (_) => const PDFViewerFromUrl(
url: 'http://africau.edu/images/default/sample.pdf',
url:
'https://ontheline.trincoll.edu/images/bookdown/sample-local-pdf.pdf',
),
),
),
Expand All @@ -40,7 +41,8 @@ class MyHomePage extends StatelessWidget {
context,
MaterialPageRoute<dynamic>(
builder: (_) => const PDFViewerCachedFromUrl(
url: 'http://africau.edu/images/default/sample.pdf',
url:
'https://ontheline.trincoll.edu/images/bookdown/sample-local-pdf.pdf',
),
),
),
Expand Down

0 comments on commit ad3d614

Please sign in to comment.