version solving failed
here is the logcat:
Because flutter_plugin_pdf_viewer 1.0.7 depends on rxdart ^0.21.0 and no versions of flutter_plugin_pdf_viewer match >1.0.7 <2.0.0, flutter_plugin_pdf_viewer ^1.0.7 requires rxdart ^0.21.0.
here is the pubspec.yaml file
cupertino_icons: ^0.1.2
badges: ^1.1.0
image_picker: ^0.6.3+1
provider: ^4.0.3
flutter_spinkit: ^4.1.1+1
firebase_auth: ^0.15.4
firebase_storage: ^3.1.1
cloud_firestore: ^0.13.1
firebase_core: ^0.4.3+3
flushbar: ^1.9.1
shimmer: ^1.0.1
cached_network_image: ^2.0.0
file_picker: ^1.4.3+2
cloud_functions: ^0.4.1+9
flutter_plugin_pdf_viewer: ^1.0.7
flutter_duration_picker: ^1.0.0
flutter_datetime_picker: ^1.3.4
numberpicker: ^1.1.0
modal_progress_hud: ^0.1.3
google_map_location_picker: ^3.2.1+1
google_maps_flutter: ^0.5.24+1
geoflutterfire: ^2.1.0
rxdart: ^0.23.1
I also faced the same error.
Manually edited the pubspec.yaml in flutter_plugin_pdf_viewer-1.0.7 folder in .pub-cache and set rxdart: ^0.21.0 to rxdart: ^0.23.1.
In flutter_plugin_pdf_viewer-1.07/lib/src/document.dart at line no: 89, changed Observable to Stream.
This is a temporary solution for this issue. It is working for me, I'm not sure this is the correct way.
flutter_plugin_pdf_viewer should update the library rxdart to 0.23.1
It looks like this repo is not maintained .. Is it active any more?
I have created a replica of this repo here: https://pub.dev/packages/pdf_viewer_jk , anyone can use it as alternative until this repo is active again.
I have created a replica of this repo here: https://pub.dev/packages/pdf_viewer_jk , anyone can use it as alternative until this repo is active again.
i cant use because the getter 'count' was called on null.
i cant use because the getter 'count' was called on null.
Looks like you are not createing / initiating the document properly.. Can you share your code?
Looks like you are not createing / initiating the document properly.. Can you share your code?
`PDFDocument document;
child: GestureDetector( onTap: () { loadFromAsset("DeLy"); Navigator.of(context).push(MaterialPageRoute( builder: (context) => InfoScreen(document: document,) )); },
void loadFromAsset(String name) async { document = await PDFDocument.fromAsset("assets/$name.pdf"); }`
and InfoScreen code : `class InfoScreen extends StatefulWidget { final PDFDocument document; InfoScreen({Key key, this.document}) : super(key: key);
@override _InfoScreenState createState() => _InfoScreenState(); }
class _InfoScreenState extends State<InfoScreen> { @override void dispose() { // TODO: implement dispose super.dispose(); }
@override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text("file PDF"), ), body: Column( children: <Widget>[ Expanded( child: Container( height: 100, child: Center( child: PDFViewer(document: widget.document,), ))) ], )); } }`
Are you sure pdf is loaded from asset? just after this line,
document = await PDFDocument.fromAsset("assets/$name.pdf");
write
print(doucment);
and see in messages/run window, if document is not null. If document is null, then you have to make sure it is not.
Are you sure pdf is loaded from asset? just after this line,
document = await PDFDocument.fromAsset("assets/$name.pdf");write
print(doucment);and see in messages/run window, if document is not null. If document is null, then you have to make sure it is not.
Thank for your help. I fixed but i get another error when i try to onTap several time. Exception caught by widgets library ══════════════════════════════════════════════════ 'package:flutter/src/widgets/framework.dart': Failed assertion: line 3949 pos 14: 'owner._debugCurrentBuildTarget == this': is not true. The relevant error-causing widget was: PDFViewer file:///F:/AppMobile/MeetingCompany/meeting/lib/Info/InfoScreen.dart:40:30
That is something you have to resolve yourslef :)
That is something you have to resolve yourslef :)
Oke. Thank you so much!
Thank for your help. I fixed but i get another error when i try to onTap several time. Exception caught by widgets library ══════════════════════════════════════════════════ 'package:flutter/src/widgets/framework.dart': Failed assertion: line 3949 pos 14: 'owner._debugCurrentBuildTarget == this': is not true. The relevant error-causing widget was: PDFViewer file:///F:/AppMobile/MeetingCompany/meeting/lib/Info/InfoScreen.dart:40:30
Have you found the solution, as I am getting the same error. It sometimes works and at sudden show this.
Please help.