mirror of
https://github.com/wgh136/pixes.git
synced 2025-09-27 12:57:24 +00:00
download and downloading page
This commit is contained in:
@@ -19,4 +19,16 @@ extension FSExt on FileSystemEntity {
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
String bytesToText(int bytes) {
|
||||
if(bytes < 1024) {
|
||||
return "$bytes B";
|
||||
} else if(bytes < 1024 * 1024) {
|
||||
return "${(bytes / 1024).toStringAsFixed(2)} KB";
|
||||
} else if(bytes < 1024 * 1024 * 1024) {
|
||||
return "${(bytes / 1024 / 1024).toStringAsFixed(2)} MB";
|
||||
} else {
|
||||
return "${(bytes / 1024 / 1024 / 1024).toStringAsFixed(2)} GB";
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user