destiny 0.2.1 copy "destiny: ^0.2.1" to clipboard
destiny: ^0.2.1 copied to clipboard

outdated

An package which generates mock-data using the PCG algorithm.

Destiny #

Destiny is a new, mock-data generator for Dart/Flutter. It uses a PCG randomness machine underneath, and static methods couched in a destiny namespace are the API. All data is guaranteed to be pseudo-random; across a million trials, no significant patterns were detected.

This package takes inspiration from Chance.js and Faker for Python; it aims to be the most complete and versatile generator of mock data.

Usage #

Simple usage is illustrated here. For more, see the API Reference:

import 'package:destiny/destiny.dart';

void main() {
  print('Random Integer from 4 to 8: ${destiny.integer(min: 4, max: 8)}');

  print('Random Boolean: ${destiny.boolean()}');

  //Note: you can also specify a pool of characters.
  print('20 Random Ascii Characters: ' + destiny.string(20));

  print('20 Random Letters: ' + destiny.letters(20));

  print('20 Random Digits: ' + destiny.digits(20));

  print('Random Email Address: ' + destiny.email());

  print('Random Phone #: ' + destiny.phone());

  //Note: female and male names are also available.
  print('Random Name: ' + destiny.name());

  print('Flip a coin: ' + destiny.coin());

  //Note: d4, d6, d8, d10, d20, d30, and d100 are available for dice-rolling.
  print('Roll a 6-sided dice: ' + destiny.d6().toString());

  print('Random address: ' + destiny.address());

  //Note: you can specify a start and end DateTime using the min and max params.
  print('Random DateTime: ' + destiny.datetime().toString());

  print('Random IPv4: ' + destiny.ipv4());

  print('Random IPv6: ' + destiny.ipv6());

  print('Random GUID: ' + destiny.guid());

  // This is the beginning of destiny's capabilities. For more, check out
  // the API reference: It explains the methods in more detail.
}

Features and bugs #

Please file feature requests and bugs at the issue tracker.


This library and its contents are subject to the terms of the Mozilla Public License, v. 2.0.
© 2020 Aditya Kishore
7
likes
25
pub points
33%
popularity

Publisher

verified publisherkishoredev.live

An package which generates mock-data using the PCG algorithm.

Repository (GitHub)
View/report issues

License

MPL-2.0 (LICENSE)

Dependencies

english_words

More

Packages that depend on destiny