标签:背景 image src 实现 process images 随机数 and color
背景:需要生成一个随机数作为api参数
import ‘dart:math‘;
/// dart  生成固定随机数
void main(){
  String alphabet = ‘qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM‘;
  int strlenght = 30; /// 生成的字符串固定长度
  String left = ‘‘;
  for (var i = 0; i < strlenght; i++) {
//    right = right + (min + (Random().nextInt(max - min))).toString();
    left = left + alphabet[Random().nextInt(alphabet.length)];
  }
print(left);
}
效果:
标签:背景 image src 实现 process images 随机数 and color
原文地址:https://blog.51cto.com/leizhu/2356829