createFile static method

dynamic createFile(
  1. {required String path,
  2. String? name}
)

Implementation

static createFile({required String path, String? name}) async {
  File? file;
  await window.fetch(path).then((r) async {
    Blob blob = await r.blob();
    file = File([blob], name ?? path.toString(), {'type': blob.type});
  });
  return file;
}