-
Notifications
You must be signed in to change notification settings - Fork 85
Open
Description
I am trying to use isBase64 to check whether base64 string is valid before write and open a pdf file, but it works only on debug mode. When I compile release and try to use it, simply does nothing.
sample code:
import 'package:path_provider/path_provider.dart';
import 'dart:convert';
import 'package:open_file/open_file.dart';
import 'package:path_provider/path_provider.dart';
Future<void> downloadPDF (String base64) async
{
if(!isBase64(base64)
{
return ;
}
var bytes = base64Decode(base64);
try {
var output = await getTemporaryDirectory();
var file = File("${output.path}/myFile.pdf");
await file.writeAsBytes(bytes.buffer.asUint8List());
await OpenFile.open("${output.path}/boleto.pdf");
} catch (e) {
print("$e");
}
}
Workaround is not to use the property and wrap code inside try block
Metadata
Metadata
Assignees
Labels
No labels