networkImage function
Future<ImageProvider>
networkImage(
- String url, {
- bool cache = true,
- Map<
String, String> ? headers, - PdfImageOrientation? orientation,
- double? dpi,
- PdfBaseCache? pdfCache,
Download an image from the network.
Implementation
Future<ImageProvider> networkImage(
String url, {
bool cache = true,
Map<String, String>? headers,
PdfImageOrientation? orientation,
double? dpi,
PdfBaseCache? pdfCache,
}) async {
pdfCache ??= PdfBaseCache.defaultCache;
final bytes = await pdfCache.resolve(
name: url,
uri: Uri.parse(url),
cache: cache,
headers: headers,
);
return MemoryImage(bytes, orientation: orientation, dpi: dpi);
}