Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flutter qr_flutter package incompatible with printing package #186

Open
abdulrehmananwar opened this issue Aug 12, 2022 · 5 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@abdulrehmananwar
Copy link

when i add printing: ^5.9.2 in pubspec.yaml it show follow error please resolve it

Because qr_flutter >=4.0.0 depends on qr ^2.0.0 and barcode >=2.2.0 depends on qr ^3.0.0, qr_flutter >=4.0.0 is incompatible with barcode >=2.2.0.
And because pdf >=3.7.1 depends on barcode ^2.2.0, qr_flutter >=4.0.0 is incompatible with pdf >=3.7.1.
And because printing 5.9.2 depends on pdf ^3.7.2 and no versions of printing match >5.9.2 <6.0.0, qr_flutter >=4.0.0 is incompatible with printing ^5.9.2.
So, because TAG depends on both printing ^5.9.2 and qr_flutter ^4.0.0, version solving failed.
pub get failed (1; So, because TAG depends on both printing ^5.9.2 and qr_flutter ^4.0.0, version solving failed.)

@abdulrehmananwar abdulrehmananwar added the bug Something isn't working label Aug 12, 2022
@waqadArshad
Copy link

@abdulrehmananwar I thought updating the qr package that this package depends upon would remove this issue but the problem is that in the updated qr package version which is 3.0.1, the QrImage widget type is changed from Widget? to QrImage?. which means that we cannot use QrImage as a Widget now.

So, did u find a solution?

@ystekno
Copy link

ystekno commented Aug 24, 2022

There is a mismatch between qr_flutter and printing.

"printing: any" gives warning:

/C:/Users/admin/flutter/.pub-cache/hosted/pub.dartlang.org/printing-5.6.5/lib/src/preview/pdf_preview.dart:169:35: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/C:/Users/admin/flutter/packages/flutter/lib/src/widgets/binding.dart').
    final locale = WidgetsBinding.instance!.window.locale;
                                  ^
/C:/Users/admin/flutter/.pub-cache/hosted/pub.dartlang.org/printing-5.6.5/lib/src/preview/pdf_preview.dart:214:37: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/C:/Users/admin/flutter/packages/flutter/lib/src/widgets/binding.dart').
      final locale = WidgetsBinding.instance!.window.locale;

"printing: ^5.9.2" gives error:

Because no versions of qr_flutter match >4.0.0 <5.0.0 and qr_flutter 4.0.0 depends on qr ^2.0.0, qr_flutter ^4.0.0 requires qr ^2.0.0.
And because barcode >=2.2.0 depends on qr ^3.0.0, qr_flutter ^4.0.0 is incompatible with barcode >=2.2.0.
Because pdf >=3.7.1 <3.8.3 depends on barcode ^2.2.0 and pdf >=3.8.3 depends on barcode ^2.2.3, pdf >=3.7.1 requires barcode ^2.2.0.
Thus, qr_flutter ^4.0.0 is incompatible with pdf >=3.7.1.
And because printing >=5.7.3 depends on pdf ^3.7.2, qr_flutter ^4.0.0 is incompatible with printing >=5.7.3.
So, because food_app depends on both printing ^5.9.2 and qr_flutter ^4.0.0, version solving failed.
pub get failed (1; So, because food_app depends on both printing ^5.9.2 and qr_flutter ^4.0.0, version solving failed.)

@waqadArshad
Copy link

waqadArshad commented Aug 24, 2022

This will keep happening and if u try to change the version of qr package this package depends upon, you will not be able to use the QrImage widget which would then throw an error. so I suggest you use:

barcode: ^2.2.3

which has all the code you might require in your project from outputting an image to outputting a printed document in the example they have provided in the demo folder of their repo at: https://github.com/DavBfr/dart_barcode

@Narven
Copy link

Narven commented Dec 16, 2022

This worked with me:

  pdf:
  printing: ^5.0.0
  qr_flutter: ^4.0.0

@vanyasem
Copy link
Contributor

vanyasem commented May 3, 2023

@Narven @waqadArshad @ystekno @abdulrehmananwar the maintainer seems inactive, I have fixed the issue in my PR: #204

And uploaded a new version of the package (4.1.0): https://pub.dev/packages/qr_widget

You can report issues with the package in my new repo: https://github.com/vanyasem/qr.widget

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants