weighted_random 0.2.1 weighted_random: ^0.2.1 copied to clipboard
Weighted Random Algorithm for Dart libraries or applications.
example/weighted_random_example.dart
import 'package:weighted_random/weighted_random.dart';
void main() {
final List<String> stringList = ["a", "b", "c", "d"];
final Map<String, dynamic> result =
weightedRandom<String>(stringList, [40, 20, 60, 20]);
print(result);
}