FLUTTER ECOSYSTEM

AnmolSethi/file_size

获取文件的可读大小。

文件大小 项目封面
Stars
5
Forks
1
最近推送(UTC)
2021年9月15日
项目状态
未归档
Anmol Sethi GitHub avatar
GITHUB User

Anmol Sethi ↗

I build Mobile Apps using #Flutter and #ReactNative, websites using #ReactJs and #NextJS, APIs using #NodeJS.

@DL-Sethi-Pvt-LtdPunjab, India官方网站 ↗
语言Dart

技术话题

此仓库发布的插件

使用的依赖

依赖清单 1 项
  • flutter_test开发依赖{"sdk":"flutter"}

原始 README

以下为英文项目原文快照,最新内容请访问 GitHub。

展开 / 收起项目 README

FileSize

pub package Dart

Get the Human readable size of the file. It is purely written in dart and support both number and string as parameters.

Examples

getSize(string or number, {PrecisionValue}): returns String

  • Direct Method Call
FileSize.getSize(1000)               '1.00 KB'
FileSize.getSize(1048576)            '1.04 MB'
FileSize.getSize(1073741824)         '1.00 GB'
FileSize.getSize(1099511627776)      '1.00 TB'
  • Method call with PrecisionValue [Optional]
FileSize.getSize(664365320, PrecisionValue.THREE)      "633.588 MB"
FileSize.getSize(4324324232343, PrecisionValue.FOUR)   "3.9321 TB"
  • Method call without decimal value
FileSize.getSize(664365320, PrecisionValue.NONE)         "633 MB"
FileSize.getSize(4324324232343, PrecisionValue.NONE)     "3 TB"

getKiloBytes(string or number, {PrecisionValue}): returns String

FileSize.getKiloBytes(54613)      '54.61 KB'