I need to avoid files bigger than 10MB.
I can check the file size doing something like this:
final file = File('whateveripicked.mp4');
print(file.lengthSync());
And do some checks after but that doesn't provide the best UX.
I'd like to exclude big files and hide them on the gallery. Is this kind of filter possible?
final f = File('whateveripicked.mp4');
int sizeInBytes = f.lengthSync();
double sizeInMb = sizeInBytes / (1024 * 1024);
if (sizeInMb > 10){
// This file is Longer the
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With