RandomUtils class

Constructors

RandomUtils.new()
factory

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

condenseWhiteSpace(String str) String
Cleans up provided string by removing extra whitespace. 通过删除额外的空格来清理提供的字符串
isWhiteSpaceOrEmptyOrNull(String? str) bool
Returns true for for all strings that are empty, null or only whitespace.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
randInt(int end, {int start = 0}) int
Generate a random number between start and end inclusive. 在开始和结束之间生成一个随机数
randomColor() int
Generates a random integer that represents a Hex color. 生成一个表示十六进制颜色的随机整数
randomElement<T>(List<T> items) → T?
从列表中返回一个随机元素。
randomString({int? length}) String
Generates a random string of provided or random length. 生成指定长度或随机长度的随机字符串
removeNonDigits(String str) String
Extracts decimal numbers from the provided string. 从提供的字符串中提取十进制数。
removeWhiteSpace(String str) String
Removes all whitespace from provided string. 从提供的字符串中删除所有空格。
toString() String
A string representation of this object.
inherited

Operators

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