RandomUtil class

@author: slc @date: 2024/03/11 随机工具

Constructors

RandomUtil()

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

getRandom() Random
getSecureRandom() Random
randomBoolean() bool
randomBytes(int length) Uint8List
生成指定长度的随机字节数组
randomChinese(int length) String
randomDay(DateTime baseDate, int minDays, int maxDays) DateTime
randomDecimal() → Decimal
randomDouble() double
randomDoubleRange(double minInclude, double maxExclude) double
randomEle<T>(List<T> list, [int? limit]) → T
randomEleList<T>(List<T> source, int count) List<T>
randomEles<T>(List<T> list, int count) List<T>
randomEleSet<T>(Iterable<T> collection, int count) Set<T>
randomInt(int limitExclude) int
randomIntRange(int minInclude, int maxExclude) int
randomInts(int length) List<int>
randomNumbers(int length) String
randomString(int length) String

Constants

baseChar → const String
baseCharNumber → const String
baseCharNumberLower → const String
baseNumber → const String