mirror of
https://github.com/venera-app/venera.git
synced 2025-09-27 15:57:25 +00:00
settings page
This commit is contained in:
@@ -186,3 +186,15 @@ class Share {
|
||||
s.Share.share(text);
|
||||
}
|
||||
}
|
||||
|
||||
String bytesToReadableString(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