David PHAM-VAN

Update dependencies

... ... @@ -127,6 +127,9 @@ class MyAppState extends State<MyApp> with SingleTickerProviderStateMixin {
final bytes = await build(pageFormat);
final appDocDir = await getApplicationDocumentsDirectory();
if (appDocDir == null) {
return;
}
final appDocPath = appDocDir.path;
final file = File(appDocPath + '/' + 'document.pdf');
print('Save as file ${file.path} ...');
... ...
... ... @@ -12,7 +12,7 @@ dependencies:
sdk: flutter
intl: ^0.17.0-nullsafety
open_file:
path_provider:
path_provider: ^2.0.0-nullsafety
printing:
url_launcher: ^6.0.0-nullsafety
... ...
... ... @@ -33,9 +33,10 @@ ffi.DynamicLibrary _open() {
/// Set the Pdf document data
void setDocumentFfi(PrintJob job, Uint8List data) {
final nativeBytes = ffi.allocate<ffi.Uint8>(count: data.length);
final nativeBytes = ffi.calloc<ffi.Uint8>(data.length);
nativeBytes.asTypedList(data.length).setAll(0, data);
_setDocument(job.index, nativeBytes, data.length);
ffi.calloc.free(nativeBytes);
}
final _SetDocument_Dart _setDocument =
... ... @@ -57,7 +58,7 @@ typedef _SetDocument_Dart = void Function(
/// Set the Pdf Error message
void setErrorFfi(PrintJob job, String message) {
_setError(job.index, ffi.Utf8.toUtf8(message));
_setError(job.index, ffi.StringUtf8Pointer(message).toNativeUtf8());
}
final _SetError_Dart _setError =
... ...
... ... @@ -11,7 +11,7 @@ environment:
flutter: ">=1.16.0"
dependencies:
ffi: ">=0.2.0-nullsafety <2.0.0"
ffi: ">=0.3.1-nullsafety.0 <2.0.0"
flutter:
sdk: flutter
flutter_web_plugins:
... ...