download some codes

This commit is contained in:
DASHU
2025-05-08 14:00:21 +08:00
parent 586e76df5c
commit a55faa3f1e
19 changed files with 702 additions and 19 deletions

View 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";
}
}