NativeFile.fromXFile constructor

NativeFile.fromXFile(
  1. XFile file,
  2. int size
)

Constructs a NativeFile from an XFile.

Implementation

factory NativeFile.fromXFile(XFile file, int size) => NativeFile(
  name: file.name,
  size: size,
  path: PlatformUtils.isWeb ? null : file.path,
  stream: file.openRead().asBroadcastStream(),
);