getBytes method

  1. @override
Future<Uint8List> getBytes(
  1. BuildContext context
)
override

Retrieves the bytes of the PDF document from the asset.

Implementation

@override
Future<Uint8List> getBytes(BuildContext context) async {
  final ByteData bytes =
      await ((_bundle != null)
          ? _bundle.load(_pdfPath)
          : DefaultAssetBundle.of(context).load(_pdfPath));
  return bytes.buffer.asUint8List();
}