weighted_random

Creator: coderz1093

Last updated:

0 purchases

weighted_random Image
weighted_random Images

Languages

Categories

Add to Cart

Description:

weighted random

Weighted Random for Dart #












Getting started #
In your flutter project add the dependency:
dependencies:
...
weighted_random:
copied to clipboard
Usage #
Import weighted_random.dart
import 'package:weighted_random/weighted_random.dart';
copied to clipboard
Example using
final List<String> stringList = ["a", "b", "c", "d"];
final Map<String, dynamic> result = weightedRandom<String>(stringList, [40, 20, 60, 20]);

print(result);
copied to clipboard
Output
{item: a, index: 0}
or
{item: b, index: 1}
or
{item: c, index: 2}
or
{item: d, index: 3}
copied to clipboard
Author #
Daisuke Takayama

@webcyou
@panicdragon
https://github.com/webcyou
https://github.com/webcyou-org
https://github.com/panicdragon
https://www.webcyou.com/

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.