dart_mock library

A dart library to get the mock value.

Only basic type values can now be mocked.

Constants

cfirstNames → const List<String>
common chinese firstName, from 'http://www.name999.net/xingming/xingshi/20131004/48.html'.
const ['伟', '芳', '娜', '秀英', '敏', '静', '丽', '强', '磊', '军', '洋', '勇', '艳', '杰', '娟'…
chineseCharacters → const String
Commonly used 500 Chinese characters, from 'http://baike.baidu.com/view/568436.htm'.
'的一是在不了有和人这中大为上个国我以要他时来用们生到作地于出就分对成会可主发年动同工也能下过子说产种面而方后多定行学法所民得经十三之进着等部度家电力里如水化高自二理起小物现实加量都两体制机当使点从业本去把性好应开它合还因由其些然前外天政四日那社义事平形相全表间样与关各重新线内数正心反你明看原又么利比或但质气第向道命此变条只没结解问意建月公无系军很情者最立代想已通并提直题党程展五果料象员革…
citiesData → const Map<String, dynamic>
chinese cities.
const {'110000' : const {'110100' : '北京城区'}, '110100' : const {'110101' : '东城区', '110102' : '西城区', '110105' : '朝阳区', …
clastNames → const List<String>
common chinese lastName, from (http://baike.baidu.com/view/1719115.htm' and 'http://xuanpai.sinaapp.com'.
const ['王', '李', '张', '刘', '陈', '杨', '赵', '黄', '周', '吴', '徐', '孙', '胡', '朱', '高'…
firstNames → const List<String>
Beyond the top 1000 names, from 'http://www.ssa.gov/oact/babynames/limits.html'.
const ['James', 'John', 'Robert', 'Michael', 'William', 'David', 'Richard', 'Charles', 'Joseph', 'Thomas', 'Christop…
lastNames → const List<String>
const ['Smith', 'Johnson', 'Williams', 'Brown', 'Jones', 'Miller', 'Davis', 'Garcia', 'Rodriguez', 'Wilson', 'Martin…
lower → const String
lower case letters.
'abcdefghijklmnopqrstuvwxyz'
maxDate → const int
max dateTime, equal 2099-12-31 23:59:59:999.
4102415999999
maxInteger → const int
max int value, equal to 2^63-1.
100
number → const String
numbers.
'0123456789'
protocols → const List<String>
common protocols.
const ['http', 'https', 'ftp', 'gopher', 'mailto', 'mid', 'cid', 'news', 'nntp', 'prospero', 'telnet', 'rlog…
provincesData → const Map<String, String>
chinese provinces.
const {'110000' : '北京市', '120000' : '天津市', '130000' : '河北省', '140000' : '山西省', '150000' : '内蒙古自治区', '210000' : &…
regions → const List<String>
chinese regions.
const ['东北', '华北', '华东', '华中', '华南', '西南', '西北']
sizes → const List<String>
common ad image sizes.
const ['300x250', '250x250', '240x400', '336x280', '180x150', '720x300', '468x60', '234x60', '88x31', '120x90', '120…
symbol → const String
symbols.
'!@#\$%^&*()[]'
tlds → const List<String>
common tlds, from 'http://www.163ns.com/zixun/post/4417.html'.
const ["com", "net", "org", "edu", "gov", "int", "mil", "cn", "com.cn", "net.cn", "gov.cn"…
upper → const String
upper case letters.
'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

Functions

boolean({int min: 5, int max: 10, bool def: true}) bool
min/max probability will return def.
capitalize(String string) String
capitalize the first letter of the word.
cfirst() String
return a random chinses firstName.
character({List<String> pools: const [lower, upper], String self: ''}) String
return a character from parameter. [...]
city({bool splice: false}) String
return a random chinese city. [...]
clast() String
return a random chinses lastName.
cname() String
return a random chinses name.
county({bool splice: false}) String
return a random chinese county. [...]
cparagraph({int min: 3, int max: 7}) String
return a random chinese paragraph. [...]
csentence({int min: 12, int max: 18}) String
return a random chinese sentence. [...]
ctitle({int min: 3, int max: 7}) String
return a random chinese title. [...]
cword({String pool: chineseCharacters, int min: 1, int max}) String
return a random chinese word. [...]
dateTime({DateTime start, DateTime end}) DateTime
return a random dateTime. [...]
dateTimeString({DateTime start, DateTime end, String format: 'yyyy-MM-dd HH:mm:ss'}) String
return a formatted random dateTime string. [...]
domain({String tld}) String
return a random domain. [...]
doubleR({int min: 0, int max: 1, int decimal: -1}) double
return a double between min to max. [...]
email({String host}) String
return a random email, example: esvhm@rkej.pg. [...]
first() String
return a random firstName.
guid() String
return a random guid.
hex({bool alpha: true}) String
return a hex color string, example: FFAABBCC. [...]
hexValue() int
return a 16 radix int, example: 4285062059. [...]
idCard() String
return a random chinese idCard.
image({String size, String background, String foreground, ImageFormat format, String text}) String
return a random image url. [...]
integer({int min: 0, int max: maxInteger}) int
return an integer between min to max. [...]
ip() String
return a random ip.
last() String
return a random lastName.
name({bool middle: false}) String
return a random english name. [...]
paragraph({int min: 3, int max: 7}) String
return a random paragraph. [...]
pick<T>(List<T> list) → T
random pick a object from list.
protocol() String
return a random protocol.
provice() String
return a random chinese provice.
region() String
return a random chinese region.
sentence({int min: 12, int max: 18}) String
return a random sentence, the first word capitalized. [...]
string({List<String> pools: const [lower, upper, number, symbol], String self: '', int min: 5, int max}) String
return a string with random character. [...]
title({int min: 3, int max: 7}) String
return a random title, all word capitalized. [...]
tld() String
return a random tld.
url({String protocol, String host}) String
return a random domain. [...]
word({int min: 3, int max: 10}) String
return a random word. [...]
zip({int length: 6}) String
return a random zip. [...]

Enums

ImageFormat
image format.