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

Request upgrade image version #114

Open
in-ealcocer opened this issue Jun 14, 2023 · 15 comments
Open

Request upgrade image version #114

in-ealcocer opened this issue Jun 14, 2023 · 15 comments

Comments

@in-ealcocer
Copy link

I can't add this dependency because it depends on a lower version of the image package. It also isn't compatible with the newest version of flutter. My question is if are you planning on upgrading the dependency?
Here is the error log:
`The current Dart SDK version is 3.0.3.

Because esc_pos_printer >=4.1.0 depends on image ^3.0.2 and
esc_pos_printer <4.1.0 doesn't support null safety, every version of esc_pos_printer requires image ^3.0.2.
So, because thor depends on both image ^4.0.17 and esc_pos_printer
any, version solving failed.

The lower bound of "sdk: '>=2.1.0 <3.0.0'" must be 2.12.0 or higher to enable null safety.
For details, see https://dart.dev/null-safety`

@huakaihualuo01
Copy link

I had the same problem

Resolving dependencies...
The lower bound of "sdk: '>=2.1.0 <3.0.0'" must be 2.12.0'
or higher to enable null safety.

The current Dart SDK (3.0.5) only supports null safety.

For details, see https://dart.dev/null-safety

@wrjcs
Copy link

wrjcs commented Jul 21, 2023

@waqadArshad
does it work?

@wrjcs
Copy link

wrjcs commented Jul 21, 2023

I have this result
fcbb1aff8f958ea2f892ff4929f4bca

@waqadArshad
Copy link

waqadArshad commented Jul 22, 2023

@wrjcs for an image, or for normal print? coz I just updated the image version and implemented the required updates in the code based on the changed functions in the image package and I tried to be very careful in that.
Please let me know what you are having issues with and I'll update you after checking it again.

@wrjcs
Copy link

wrjcs commented Jul 22, 2023

For image
It got your code, I print it as the image above
Did you teste your code, does it work correctly?

@waqadArshad
Copy link

@wrjcs as far as text based print is concerned, yes, I did test it and it was working properly. But I did not test it with an image so can't surely say anything about that. and for your print, I cannot make out if it was a text based print or an image based one. so let me know which one is that and I'll check it.

@waqadArshad
Copy link

@wrjcs ok. sorry, I misread your message. So it was an image. As I mentioned, I did not test it with an image. And if you can wait, I'm kinda busy tomorrow, so I'll probably check this on Monday. Please make sure to remind me about that. Thanks

@wrjcs
Copy link

wrjcs commented Jul 22, 2023

@waqadArshad
Thank you for your réponse.
Sure, I can wait
I’m waiting for you

@waqadArshad
Copy link

@wrjcs can you please share this image here? I mean the image that you are trying to print. Thanks

@waqadArshad
Copy link

waqadArshad commented Jul 22, 2023

@wrjcs I checked and it prints alright. I don't think the problem is with this package. You should check your implementation or your printer settings.

I just printed this image:
5665450

and this is the result:
printed image

I printed more images than just this one but I'm adding this one for your reference.

Please let me know if you need any more help.

Repository owner deleted a comment from waqadArshad Jul 23, 2023
@wrjcs
Copy link

wrjcs commented Jul 24, 2023

hello,
this is my image original
20230724105444
could you give the the code that you load image and print
Thanks.

@waqadArshad
Copy link

waqadArshad commented Jul 24, 2023

@wrjcs Sure, here it is:

Use the following import:

import 'package:image/image.dart' as img;

And then use this in your print method.


 List<int> bytes = [];
    // Xprinter XP-N160I
    final profile = await CapabilityProfile.load(name: 'XP-N160I');
    final generator = Generator(PaperSize.mm80, profile);
    bytes += generator.setGlobalCodeTable('CP1252');
    bytes += generator.text('Test Print', styles: const PosStyles(align: PosAlign.center));
    bytes += generator.hr();

    //+ ~~~~~~~~~~~~~~~~~~~~~~~~ Image Section ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    final ByteData data = await rootBundle.load(Assets.checkImages5665450);
    final Uint8List imageBytes = data.buffer.asUint8List();
    final img.Image image = img.decodeImage(imageBytes)!;

    final img.Image resized = img.copyResize(image, width: 558);
    bytes += generator.image(resized);
    
    //! ~~~~~~~~~~~~~~~~~~~~~~~~ Image Section End ~~~~~~~~~~~~~~~~~~~~~~~~~

    // printEscPos is the default method from another package (link provided below):    
    printEscPos(bytes, generator, context);
  }

printEscPos is the default method from the example of:
flutter_pos_printer_platform

@waqadArshad
Copy link

@andrey-ushakov if you can delete my comments, telling people to use my fork in which I was also going to add all (or most of) the code from the Pull Requests and definitely do extensive testing for each, then I believe you can also maintain the repo. I was not trying to take over your package or something. It was always going to be your fork, I just wanted to get the users an updated version of it. But it's alright. I just wanted to say this because I and all other users need you to either maintain it or assign someone else to maintain this package. Many developers depend on it, so please consider this a humble request and update and maintain the package.

And Thanks a lot for this amazing package. I appreciate the efforts and time you put into it. And I am extremely sorry for any misunderstanding.

@TamirlanBir
Copy link

@waqadArshad Hello ! can u help me with this error
RangeError (index): Invalid value: Not in inclusive range 0..9638: 9639

@waqadArshad
Copy link

what is causing this @TamirlanBir?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants