ExtensionNum extension

num 扩展

on

Properties

acos double
no setter
asin double
no setter
cos double
no setter
days Duration
no setter
exp double
no setter
heightBox Widget
Converts the number into a SizedBox with the height as that number.
no setter
hours Duration
no setter
isEven bool
Returns if the number is even
no setter
isNegative bool
Returns if the number is negative
no setter
isOdd bool
Returns if the number is odd
no setter
isPositive bool
Returns if the number is positive
no setter
length int
num 长
no setter
log double
no setter
microseconds Duration
微秒
no setter
milliseconds Duration
毫秒
no setter
minutes Duration
no setter
seconds Duration
no setter
sqrt double
no setter
squareBox Widget
Converts the number into a SizedBox with the width & height as that number.
no setter
tan double
no setter
toClipboard Future<void>
复制到粘贴板
no setter
widthBox Widget
Converts the number into a SizedBox with the width as that number.
no setter

Methods

atan2(num value) double
contains(Pattern other, [int startIndex = 0]) bool
是否包含 other
fromMicrosecondsSinceEpoch({bool isUtc = false}) DateTime?
微秒时间戳转换 DateTime
fromMillisecondsSinceEpoch({bool isUtc = false}) DateTime?
毫秒时间戳转换 DateTime
generate<T>(T generator(int index), {bool growable = true}) List<T>
创建指定长度的List
insert(int index, dynamic element) → dynamic
element 无论是 int 还是 double 返回 num 自己的类型 element 是String 返回 String 类型
max<T extends num>(T value) → T
min<T extends num>(T value) → T
padLeft(int width, [String padding = ' ']) String
toChineseNumbers({bool isSimplify = true, bool isWeek = false}) String
数字转中文 简繁体
toFileSize() String
int 字节转 k MB GB