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

EAN8 with error #11

Closed
AndrewPiterov opened this issue Sep 17, 2019 · 1 comment
Closed

EAN8 with error #11

AndrewPiterov opened this issue Sep 17, 2019 · 1 comment

Comments

@AndrewPiterov
Copy link

Hi!
I try to display an EAN-8 barcode with value '90311130'.
But I get an exception 'RangeError (index): Invalid value: Not in range 0..9, inclusive: 10'

return Center( child: Container( child: BarCodeImage( data: '90311130', codeType: BarCodeType.CodeEAN8, barHeight: 100.0, hasText: true, onError: (error) { print("Generate barcode failed. error msg: $error"); }, ), ));

Exception:

════════ Exception caught by rendering library ═════════════════════════════════
The following RangeError was thrown during paint():
RangeError (index): Invalid value: Not in range 0..9, inclusive: 10

User-created ancestor of the error-causing widget was
BarCodeImage
lib/pages/mobil_cards.dart:392
When the exception was thrown, this was the stack
#0 List.[] (dart:core-patch/growable_array.dart:147:60)
#1 BarCodePainter._drawBarCodeEAN8
package:barcode_flutter/src/barcode_painter.dart:574
#2 BarCodePainter.paint
package:barcode_flutter/src/barcode_painter.dart:30
#3 RenderCustomPaint._paintWithPainter
package:flutter/…/rendering/custom_paint.dart:528
#4 RenderCustomPaint.paint
package:flutter/…/rendering/custom_paint.dart:566
...
The following RenderObject was being processed when the exception was fired: RenderCustomPaint#74661
RenderObject: RenderCustomPaint#74661
parentData: offset=Offset(5.0, 5.0) (can use size)
constraints: BoxConstraints(w=152.0, h=98.0)
size: Size(152.0, 98.0)
════════════════════════════════════════════════════════════════════════════════

@bigship
Copy link
Owner

bigship commented Sep 17, 2019

Hi, there's a fix on that issue. Please update to version 1.0.2
EAN-8 barcode with value '90311130' can render OK and scan correctly now.
I'll close this issue.

@bigship bigship closed this as completed Sep 17, 2019
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

2 participants