Overview
The rnd package enhances Dart's Random class with extension methods and utility functions, providing a globally accessible random instance for concise, readable code. It enables simple operations like generating random numbers (rnd(10)), selecting random items from lists (rnd.getItem(list)), and generating biased bits (rnd.getBit(0.8)). Designed for ease of use in games, simulations, and data shuffling, it streamlines common randomization tasks without boilerplate. The package is lightweight and compatible across all major platforms.
Use cases
- Game development
- Random item selection
- Simulations
- Data shuffling
- Procedural content generation
Key features
- Global random instance
- Extension methods on Random
- Simple syntax like rnd(10)
- Support for weighted choices
- Cross-platform compatibility
Suitable for
- Developers seeking quick random utilities
- Game and app creators
- Prototyping and testing
Considerations
- Not suitable for cryptographic randomness
- Limited to non-security-critical use cases
- Requires understanding of basic randomization concepts