chance_dart 0.0.1+1 copy "chance_dart: ^0.0.1+1" to clipboard
chance_dart: ^0.0.1+1 copied to clipboard

Chance Dart is a free Open Source project that lets you create random strings, integers, and other things to help with tiresome tasks, especially when building automated tests or wherever else you req [...]

example/chance_dart_example.dart

import 'package:chance_dart/chance_dart.dart' as chance;

void main() {
  /// Usage
  /// ```chance.[random value to generate]```
  ///
  try {
    // Generate random address
    print(chance.address().toJson());
    // Generate random age
    print('AGE');
    print(chance.age(
      max: 100,
    ));
    // Generate random amPm
    print(chance.amPm());
    // Generate random age
    print(chance.animal());
    // Generate random areaCode
    print(chance.areaCode());
    // Generate random age
    print(chance.birthday());
    // Generate random boolean
    print(chance.boolean());
    print(chance.birthday());
    print(chance.cc(
      ccType: chance.CCType.mastercard,
      // visaLength: 20,
    ));
  } catch (e) {
    if (e is chance.ChanceException) {
      print(e.message);
    }
  }
  // Generate random boolean
  // print(chance.ccType());
  // print(UserWrapper().generatedModel());
  // print(ChanceModelWrapper().generatedModels());
  // Generate random address
  print(chance.address().toJson());
  // Generate random age
  print(chance.age());
  // Generate random amPm
  print(chance.amPm());
  // Generate random age
  print(chance.animal());
  // Generate random areaCode
  print(chance.areaCode());
  // Generate random age
  print(chance.birthday());
  // Generate random boolean
  print(chance.boolean());

  /// for more random values checkout the docs https://docs.page/Yczar/chance-dart
}
28
likes
125
pub points
8%
popularity

Publisher

verified publisherflutterbytes.io

Chance Dart is a free Open Source project that lets you create random strings, integers, and other things to help with tiresome tasks, especially when building automated tests or wherever else you require anything random.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

dart_geohash, equatable, meta

More

Packages that depend on chance_dart