https://github.com/dinkopehar/mock_data
Generate random data(string, integer, IPs etc...) using Dart.
https://github.com/dinkopehar/mock_data
dart fake-data mock mock-data random
Last synced: about 1 year ago
JSON representation
Generate random data(string, integer, IPs etc...) using Dart.
- Host: GitHub
- URL: https://github.com/dinkopehar/mock_data
- Owner: dinkopehar
- License: mit
- Created: 2018-12-17T00:11:22.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-03-18T10:57:36.000Z (over 2 years ago)
- Last Synced: 2025-04-10T15:54:00.982Z (about 1 year ago)
- Topics: dart, fake-data, mock, mock-data, random
- Language: Dart
- Homepage: https://pub.dartlang.org/packages/mock_data
- Size: 95.7 KB
- Stars: 14
- Watchers: 3
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
## Features
API provides generation of:
- *Integers* in any range of numbers
- *Strings* with various characters and length
- *Colors* represented with needed color space
- *Date*s between different moments in time
- *Name*s such as John or Mary
- *UUIDv4* and *Timestamp-first UUIDs*
- *URL*s with many fragments
- *IPv4* and *IPv6*
- *Locations* as either random points or in specified radius
## Usage
A simple usage example:
```dart
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`
### Contributors
- [Dinko Pehar](https://github.com/dinko-pehar)
- [Nagasai Bodepudi](https://github.com/nagasaiBodepudi)
- [Volodymyr Buberenko](https://github.com/vbuberen)
- [Ivan Murashov](https://github.com/kifio)
### License
[MIT][]
[MIT]: https://github.com/dinkopehar/mock_data/blob/master/LICENSE.txt
[examples]: https://pub.dev/packages/mock_data#-example-tab-
