mirror of
https://github.com/haorendashu/nowser.git
synced 2025-12-17 18:04:18 +01:00
download some codes
This commit is contained in:
12
lib/util/file_size_util.dart
Normal file
12
lib/util/file_size_util.dart
Normal file
@@ -0,0 +1,12 @@
|
||||
class FileSizeUtil {
|
||||
static String getFileSize(int fileSize) {
|
||||
if (fileSize > 1024 * 1024 * 1024) {
|
||||
return "${fileSize ~/ (1024 * 1024 * 1024)} GB";
|
||||
} else if (fileSize > 1024 * 1024) {
|
||||
return "${fileSize ~/ (1024 * 1024)} MB";
|
||||
} else if (fileSize > 1024) {
|
||||
return "${fileSize ~/ 1024} KB";
|
||||
}
|
||||
return "$fileSize B";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user