flutter_plugin_pdf_viewer icon indicating copy to clipboard operation
flutter_plugin_pdf_viewer copied to clipboard

version solving failed

Open dsourav opened this issue 5 years ago • 11 comments

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

dsourav avatar Feb 29 '20 20:02 dsourav

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

alexsundersoftsuave avatar Mar 04 '20 08:03 alexsundersoftsuave

It looks like this repo is not maintained .. Is it active any more?

jawadsahil avatar Mar 10 '20 15:03 jawadsahil

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.

jawadsahil avatar Mar 11 '20 01:03 jawadsahil

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.

Allviss0211 avatar Mar 27 '20 03:03 Allviss0211

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?

jawadsahil avatar Mar 27 '20 03:03 jawadsahil

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,), ))) ], )); } }`

Allviss0211 avatar Mar 27 '20 04:03 Allviss0211

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.

jawadsahil avatar Mar 27 '20 04:03 jawadsahil

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

Allviss0211 avatar Mar 27 '20 04:03 Allviss0211

That is something you have to resolve yourslef :)

jawadsahil avatar Mar 27 '20 04:03 jawadsahil

That is something you have to resolve yourslef :)

Oke. Thank you so much!

Allviss0211 avatar Mar 27 '20 04:03 Allviss0211

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.

deep1931 avatar Apr 16 '20 07:04 deep1931