กระพือภาพขนาดแฟ้ม

รหัสตัวอย่าง

8
0

ได้ขนาดแฟ้มกระพือภาพ

import 'dart:io';

//Here's the method to get file size:

double getFileSize(File file){      
	int sizeInBytes = file.lengthSync();
	double sizeInMb = sizeInBytes / (1024 * 1024);
    return sizeInMb;
}

//Alternatively for extension:

extension FileUtils on File {
	get size {
    	int sizeInBytes = this.lengthSync();
		double sizeInMb = sizeInBytes / (1024 * 1024);
    	return sizeInMb;
    }
}
1
0

กระพือภาพขนาดแฟ้ม

import 'dart:io';

//Here's the method to get file size:

double getFileSize(File file){      
    int sizeInBytes = file.lengthSync();
    double sizeInMb = sizeInBytes / (1024 * 1024);
    return sizeInMb;
}

//Alternatively for extension:

extension FileUtils on File {
    get size {
        int sizeInBytes = this.lengthSync();
        double sizeInMb = sizeInBytes / (1024 * 1024);
        return sizeInMb;
    }
}

หน้าคล้ายกัน

คล้ายกันหน้ากับตัวอย่าง

ในภาษาอื่นๆ

หน้านี้อยู่ในภาษาอื่นๆ

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................