getRandomDouble static method
获取随机小数(默认包含最大最小值)
Implementation
static double getRandomDouble(double min, double max, {bool inclusiveMin = true, bool inclusiveMax = true}) {
assert(min <= max, 'Min must be less than or equal to Max,Invalid arguments: min=$min, max=$max');
double minVal = inclusiveMin ? min : min + 0.0000000001;
double maxVal = inclusiveMax ? max : max - 0.0000000001;
return minVal + Random.secure().nextDouble() * (maxVal - minVal);
}