weighted_random_picker 1.0.0 copy "weighted_random_picker: ^1.0.0" to clipboard
weighted_random_picker: ^1.0.0 copied to clipboard

The elements of the array given to the constructor can be randomly picked with weights according to the probabilityWeight property of each element.

Use this package as a library

Depend on it

Run this command:

With Dart:

 $ dart pub add weighted_random_picker

With Flutter:

 $ flutter pub add weighted_random_picker

This will add a line like this to your package's pubspec.yaml (and run an implicit dart pub get):

dependencies:
  weighted_random_picker: ^1.0.0

Alternatively, your editor might support dart pub get or flutter pub get. Check the docs for your editor to learn more.

Import it

Now in your Dart code, you can use:

import 'package:weighted_random_picker/weighted_random_picker.dart';
0
likes
150
points
7
downloads

Publisher

verified publishermalt03.com

Weekly Downloads

The elements of the array given to the constructor can be randomly picked with weights according to the probabilityWeight property of each element.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

More

Packages that depend on weighted_random_picker