get_random_from_list 0.1.1

Dart native js
Flutter Android iOS web

An extension method for the List class that retrieves a random element from the list.

get_random_from_list #

An extension method for the List class that retrieves a random element from the list.

Usage #

import 'package:get_random_from_list/get_random_from_list.dart';

Importing get_random_from_list adds a single extension method to the [List] class called [random], which retrieves a value from the list utilizing dart:math's [Random] number generator.

Like [Random], the [random] method accepts an optional [seed] value.

final List<int> myList = <int>[0, 1, 2, 3, 4, 5, 6, 7, 8, 9];

print(myList.random()); // Prints a random number 0-9.
0
likes
100
pub points
26%
popularity

Publisher

jamesalex.dev

An extension method for the List class that retrieves a random element from the list.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD (LICENSE)

More

Packages that depend on get_random_from_list