download method Null safety

Future<Uint8List?> download(
  1. String url,
  2. [void onBytesReceived(
    1. int?,
    2. int
    )?]
)

Implementation

static Future<Uint8List?> download(String url,
    [void Function(int?, int)? onBytesReceived]) {
  if (url.contains("youtube") || url.contains("youtu.be")) {
    return downloadFromYoutube(url, onBytesReceived);
  } else {
    return ModernFormDownloadHelper.downloadWithProgress(url,
        onBytesReceived: onBytesReceived);
  }
}