get_random_from_list 0.1.0 copy "get_random_from_list: ^0.1.0" to clipboard
get_random_from_list: ^0.1.0 copied to clipboard

discontinuedreplaced by: list_utilities
outdated

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
30
pub points
0%
popularity

Publisher

verified publisherjamesalex.dev

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

Repository (GitHub)
View/report issues

License

BSD-2-Clause (LICENSE)

More

Packages that depend on get_random_from_list