Open bruceanwyl opened 5 years ago
Put the BarCodeImage
in a FittedBox
and it will scale the barcode to your width constraints, otherwise i agree, it should use constraints to find out how much space it can use, if its not enough space it should produce an overflow like Text
widget
This is not the same as #15. That was a miscalculation of the canvas size required to paint the barcode value with the specified line width.
This issue occurs when the barcode widget is contained by a widget that is smaller than the calculated canvas size. In the example below, the barcode is in an Expanded widget between two SizedBox widgets. The code snippet below shows how the border around the canvas is applied.
So, rather than this, it would be better if the painter was aware of the actual width of canvas it has to work with and, if the canvas is too small, scale the barcode line width accordingly.