Skip to content

Commit

Permalink
Fix demo project
Browse files Browse the repository at this point in the history
  • Loading branch information
DavBfr committed Dec 15, 2023
1 parent 74f0e47 commit 0710951
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions demo/lib/download.dart
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,14 @@ class Download extends StatelessWidget {
),
));

final path = await getSavePath();
if (path != null) {
final location = await getSaveLocation();
if (location != null) {
final file = XFile.fromData(
await pdf.save(),
name: '${bc.name}.pdf',
mimeType: 'application/pdf',
);
await file.saveTo(path);
await file.saveTo(location.path);
}
}

Expand All @@ -136,14 +136,14 @@ class Download extends StatelessWidget {
drawBarcode(image, bc, conf.normalizedData, font: im.arial48);
final data = im.encodePng(image);

final path = await getSavePath();
if (path != null) {
final location = await getSaveLocation();
if (location != null) {
final file = XFile.fromData(
Uint8List.fromList(data),
name: '${bc.name}.png',
mimeType: 'image/png',
);
await file.saveTo(path);
await file.saveTo(location.path);
}
}

Expand All @@ -157,14 +157,14 @@ class Download extends StatelessWidget {
fontHeight: conf.fontSize,
);

final path = await getSavePath();
if (path != null) {
final location = await getSaveLocation();
if (location != null) {
final file = XFile.fromData(
Uint8List.fromList(utf8.encode(data)),
name: '${bc.name}.svg',
mimeType: 'image/svg+xml',
);
await file.saveTo(path);
await file.saveTo(location.path);
}
}
}

0 comments on commit 0710951

Please sign in to comment.