Manage memory when picking large files
masterWhen picking multiple or large files on mobile/desktop, avoid loading all bytes into memory using withData: true, as this can cause out-of-memory errors. Instead, use withReadStream: true and keep withData: false to handle files efficiently.
FilePickerResult? result = await FilePicker.pickFiles(
allowMultiple: true,
withData: false,
withReadStream: true,
);