Destiny is a new, mock-data generator for Dart/Flutter

Related tags

Utilities destiny
Overview

Destiny

Destiny is a new, mock-data generator for Dart/Flutter. It uses static methods couched in a destiny namespace as the API.

It also exposes an alternative to the dart:math randomness machine, using the PCG algorithm. You can access this by importing the file "package:destiny/pcg.dart". Support for this algorithm is provided as "best-effort": it does not have noticeable statistical flaws, but the algorithm was specified for languages that support unsigned integers (Dart does not).

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'; // import destiny methods
import 'package:destiny/pcg.dart'; // import pcg

destiny.random = PCGRandom(); // defaults if unset to dart:math's Random(). You can also use Random.secure() here.

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
You might also like...

Starter project and code generator for Flutter/Redux

Starter project and code generator for Flutter/Redux

Flutter Redux Starter/Code Generator Videos Short video ~ 1 minute Long video ~ 10 minutes We're using this approach to develop the Flutter app for In

Dec 12, 2022

The Flutter code generator for your assets, fonts, colors, … — Get rid of all String-based APIs.

The Flutter code generator for your assets, fonts, colors, … — Get rid of all String-based APIs.

The Flutter code generator for your assets, fonts, colors, … — Get rid of all String-based APIs. Inspired by SwiftGen. Motivation Using asset path str

Jan 6, 2023

A Flutter curl-command generator for Dio

A Flutter curl-command generator for Dio

curl_logger_dio_interceptor A Flutter curl-command generator for Dio. Easily test your Flutter-made requests in your favorite terminal or even in Post

Nov 17, 2022

Flutter Word generator

wordpair_generator A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you start

Dec 3, 2021

Random color generator for Flutter

Random color generator for Flutter

Random color generator Pub link: https://pub.dartlang.org/packages/random_color This library will generate random colors that are visually pleasing an

Jun 13, 2022

A Flutter Word generator App to improve English vocabulary

A Flutter Word generator App to improve English vocabulary

Word generator App to improve English vocabulary: Add English words you don't know and their translation, then you need to answer what is the translat

Dec 12, 2021

Swagger/OpenAPI code generator based on Chopper and JsonAnnotation for Flutter

Swagger/OpenAPI code generator based on Chopper and JsonAnnotation for Flutter

Code partially generated with chopper 📣 Build dart types from Swagger/OpenAPI schemas SwaggerDartCodeGenerator is a code generator that looks for *.s

Jan 5, 2023

A certificate generator app developed in Flutter with love.

A certificate generator app developed in Flutter with love.

Holden Certificate Generator made with Flutter. Dependencies spreadsheet_decoder path_provider file_picker pdf_viewer_plugin pdf permission_handler sh

Jan 4, 2023

Flutter Google Sheet localizations generator

 Flutter Google Sheet localizations generator

Flutter Google Sheet localizations generator Generates a localizations delegate from an online Google Sheet file. Install Add the following to your pu

Dec 19, 2022
GPT-3 recipe generator for the GPT-3 Makeathon by TUM.AI. Developed by team Taste the data.

GPT-3 Makeathon by TUM.AI - Team: Taste the Data Team - Taste the Data: Carmen Heger <@stedomedo> David Stiftl <@stiftlD> Christopher Schütz <@cdschtz

Oliver Klukas 11 Dec 4, 2022
Environment specific config generator for Dart and Flutter applications during CI/CD builds

Environment Config Generator Environment specific config generator. Allows to specify env configuration during CI/CD build. Primarily created to simpl

Denis Beketsky 86 Dec 2, 2022
🚀The Flutter dart code generator from zeplin. ex) Container, Text, Color, TextStyle, ... - Save your time.

Flutter Gen Zeplin Extension ?? The Flutter dart code generator from zeplin. ex) Container, Text, Color, TextStyle, ... - Save your time. ⬇ 1.1k Getti

NAVER 49 Oct 12, 2022
OpenAPI generator for Dart & Flutter

Fantom Fantom is a cli tool for generating API layer based on OpenAPI Spec. Usage Install fantom $ dart pub global activate fantom Generate API client

6thSolution 13 Oct 18, 2022
OpenAPI generator for Dart & Flutter

Fantom Fantom is a cli tool for generating API layer based on OpenAPI Spec. Usage Install fantom $ dart pub global activate fantom Generate API client

REKAB 13 Oct 18, 2022
Dart Code Generator for generating mapper classes

Smartstruct - Dart bean mappings - the easy nullsafe way! Code generator for generating type-safe mappers in dart, inspired by https://mapstruct.org/

Nils 28 Nov 29, 2022
The Dart code generator for your package versions. 🎯

The Dart code generator for your package versions. There is no way to get the package version from the code in the Dart ecosystem. Installation Add bu

Daichi Furiya 12 Dec 14, 2022
Dart R-file generator for build_runner

r_resources This package is made for R-file code generation using build_runner.

Ivanov Nikita 0 Dec 17, 2021
Arissounddart - a Command-line SoundSprite generator for Dart

SoundDart SoundDart is a Command-line SoundSprite generator for Dart. It require

Behruz Hurramov 1 Jan 9, 2022