DavBfr / dart_barcode

Barcode generation library
https://pub.dev/packages/barcode
Apache License 2.0
132 stars 41 forks source link

Save as file support #61

Closed thisFemi closed 5 months ago

thisFemi commented 1 year ago

Please add a feature that allow users save to any/ specified format

DavBfr commented 1 year ago

What do you mean?

thisFemi commented 1 year ago

Letting users have the option to save the barcode in the BarcodeWidget.... instead of going through the RepaintBoundary method

DavBfr commented 1 year ago

There is a .toSvg() method.

// Create a DataMatrix barcode
final dm = Barcode.dataMatrix();

// Generate a SVG with "Hello World!"
final svg = bc.toSvg('Hello World!', width: 200, height: 200);

// Save the image
await File('barcode.svg').writeAsString(svg);
thisFemi commented 1 year ago

Oh great, i couldn’t find it at first. Thanks On Wed, Jun 7, 2023 at 1:26 PM David PHAM-VAN @.***> wrote:

There is a .toSvg() method.

// Create a DataMatrix barcodefinal dm = Barcode.dataMatrix(); // Generate a SVG with "Hello World!"final svg = bc.toSvg('Hello World!', width: 200, height: 200); // Save the imageawait File('barcode.svg').writeAsString(svg);

— Reply to this email directly, view it on GitHub https://github.com/DavBfr/dart_barcode/issues/61#issuecomment-1580713961, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN4HND6DD4SMLLKC4EEUOMTXKBXQZANCNFSM6AAAAAAY4W547U . You are receiving this because you authored the thread.Message ID: @.***>