rand 3.0.2 copy "rand: ^3.0.2" to clipboard
rand: ^3.0.2 copied to clipboard

Powerful random data generator for Dart. Generate numbers, text, names, passwords, colors, dates, and more. Perfect for testing, mocking, and games.

Changelog #

3.0.2 #

  • Reverted example

3.0.1 #

Breaking Changes #

  • integer() and float() now use named parameters (min:, max:)

  • sample() replaces weightedRandomizedArray():

    // Before
    Rand.weightedRandomizedArray(weights: [...], pool: items, size: 5);
      
    // After
    Rand.sample(from: items, count: 5);                 // equal probability
    Rand.sample(from: items, count: 5, weights: [...]); // weighted
    
  • charCode() and safeCharCode() replace char() and charSecure()

  • Removed dateTimeYear() — use dateTime(DateTime(year1), DateTime(year2))

  • Collection params renamed to from

  • Password params simplified: lowercase, uppercase, digits, symbols

New #

  • color(), colorDark(), colorLight() for CSS colors
  • CSSColors enum with 148 named colors

Improved #

  • Proper ArgumentError exceptions instead of assertions
  • 40+ tests with checks package

2.0.3 #

  • Updated dependencies

2.0.2 #

  • Fixed boolean() regression
  • Fixed max int for web

2.0.1 #

  • Fixed nullable() default value

2.0.0 #

  • Removed documentId, uid — use id()
  • Renamed mayBeNullnullable
  • Added alias, firstName, lastName, city, latitude, longitude

1.0.0 #

  • Initial release
4
likes
150
points
210
downloads

Publisher

verified publishermehmetesen.com

Weekly Downloads

Powerful random data generator for Dart. Generate numbers, text, names, passwords, colors, dates, and more. Perfect for testing, mocking, and games.

Homepage
Repository (GitHub)
View/report issues

Topics

#random #testing #mock #faker #generator

Documentation

API reference

License

MIT (license)

Dependencies

meta

More

Packages that depend on rand