mock_data 1.2.7 copy "mock_data: ^1.2.7" to clipboard
mock_data: ^1.2.7 copied to clipboard

outdated

Generate random data using Dart. Can be used to create random strings, integers, names, colors, IPs, UUIDs, URLs and dates.

Mock Data Logo
Build Status License Version
Generate random data using Dart

Features #

API provides generation of:

  • Integers in any range of numbers
  • Strings with various characters and length
  • Colors represented with needed color space
  • Dates between different moments in time
  • Names such as John or Mary
  • UUIDv4 and Timestamp-first UUIDs
  • URLs with many fragments
  • IPv4 and IPv6

Usage #

A simple usage example:

import 'package:mock_data/mock_data.dart';

main() {

  mockName();           // Generate male or female first name. 
  mockName('male');     // Generate male first name. 
  mockName('female');   // Generate female first name. 

  mockInteger(1, 6);    // Generate integer in range from 1 do 6.

  mockString(16);       // Generate string of length 16.
  
  mockIPv4();           // Generate IPv4 represented with 
                        // format(default is '*.*.*.*') as String. 
  
  mockIPv6();           // Generate IPv6, same usage as with IPv4.

  mockColor('hex');     // Generate color represented in hex format.
  mockColor('rgb');     // Generate color represented in RGB format.
  
  mockUUID();           // Generate UUIDv4
  
}

These are some basic examples. There are many more methods and they all support tweeking of parameters to suit you in generating random data. By reading examples you can learn more about functionality and usage of mock_data

Contributors #

License #

MIT

29
likes
0
points
845
downloads

Publisher

unverified uploader

Weekly Downloads

Generate random data using Dart. Can be used to create random strings, integers, names, colors, IPs, UUIDs, URLs and dates.

Repository (GitHub)
View/report issues

License

unknown (license)

More

Packages that depend on mock_data