1+ import 'dart:async' ;
12import 'dart:math' ;
23
34import 'text.dart' ;
@@ -6,7 +7,7 @@ import 'text.dart';
67class Rand extends Text {
78 /// Random text having [src] as the source of eligible characters, [len] as
89 /// the length, and [index] as the index randomizer.
9- Rand (int len, Future <String > src, [Random ? index])
10+ Rand (int len, FutureOr <String > src, [Random ? index])
1011 : super (
1112 Future (() async {
1213 final buffer = StringBuffer ();
@@ -20,12 +21,8 @@ class Rand extends Text {
2021 );
2122
2223 /// Random digits [0–9] of length [len] .
23- Rand .dig (int len, [Random ? index]) : this . str (len, '0123456789' , index);
24+ Rand .dig (int len, [Random ? index]) : this (len, '0123456789' , index);
2425
2526 /// Random hex digits [0–9a-f] of length [len] .
26- Rand .hex (int len, [Random ? index]) : this .str (len, '0123456789abcdef' , index);
27-
28- /// Random string of length [len] from [src] .
29- Rand .str (int len, String src, [Random ? index])
30- : this (len, Future .value (src), index);
27+ Rand .hex (int len, [Random ? index]) : this (len, '0123456789abcdef' , index);
3128}
0 commit comments