CommonUtil class

通用工具类 提供一些常用的通用方法

Constructors

CommonUtil()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

copy(String text) → void
复制文本到剪切板
fillSpaceStr(List<String> strs) List<String>
填充字符串数组,使每个字符串长度相同(前后补空格)
randomColor() Color
随机生成一个颜色
randomColorInRange(Color baseColor, {double variation = 0.2}) Color
基于指定基色生成相近色随机颜色
randomIndexByWeight(List<double> weights) int
根据权重列表随机返回索引,权重累积法
randomInt(int min, int max) int
获取min, max范围内的随机整数