[Flutter] 随机数

1,368 阅读1分钟

1: 生成随机数0和1

1: 导入
import 'dart:math';

2: 代码如下 01
final r = Random().nextInt(2);