v2.0.1
mock_data
使用 Dart 生成随机数据。可用于创建随机字符串、整数、名称、颜色、IP 地址、UUID、URL 和日期。
29喜欢 2290近 30 天下载160Pub 分数
AndroidiOSWebmacOSWindowsLinux
使用 Dart 生成随机数据(字符串、整数、IP 等)。
以下为英文项目原文快照,最新内容请访问 GitHub。
API provides generation of:
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
mockLocation(); // Generate random location.
mockLocation(53.55, 108.14, 1000); // Generate random location in 1000 m radius from the specified coordinates.
}
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
依赖清单 2 项
^1.17.5^1.11.0先按使用场景筛选,再比较项目活跃情况,最后到原始仓库核对使用要求。
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗