random_user 0.3.0

  • README.md
  • Example
  • Installing
  • Versions
  • 81

random_user Build Status Coverage Status pub package

Framework to Generate Random Users - An Unofficial Dart/Flutter SDK for https://randomuser.me

random_user is an easy to use Dart framework that provides the ability to generate random users and their accompanying data for your Dart of Flutter applications. It utilizes randomuser.me API to generate the data.

Usage #

Import the framework

import 'package:random_user/random_user.dart';

Create an instance of RandomUser class and use the getUser, getUsers or getUsersWithInfo methods. getUser will return a randomly generated user model. Use getUsers to get a list of random users. Call getUsersWithInfo to get not only a list of users, but additional Info structure which may help with pagination.

To get just a random user use:

  final api = RandomUser();
  final user = await api.getUser();

More complex sample

  final api = RandomUser();
  final users = await api.getUsers(gender: 'female', 
                                   password: 'upper,lower,number,8', 
                                   nationalities: 'NO', 
                                   results: 10);

Will return 10 female user accounts from Norway with alpha-numberical 8-symbol passwords.

License #

random_user is released under an MIT License. See LICENSE for details.

Changelog #

0.3.0 #

  • Reformat code

0.2.0 #

  • Change Dart requitement to >= 2.1.0
  • Remove unneded dependency

0.1.0 #

  • Version bump to not to scary Pub users
  • Add example
  • Code formatting

0.0.1 #

Initial Version of the library.


import 'package:random_user/random_user.dart';

main() async {
  final api = RandomUser();

  final randomUser = await api.getUser();
  print("Just a random user's email:");

  final randomList = await api.getUsers(results: 3);
  print("Three random users:");
  randomList.forEach((u) => print("${u.name.first} ${u.name.last}"));

  final knownUser = await api.getUsersWithInfo(seed: 'flutter');
  print("Always the same user:");

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  random_user: ^0.3.0

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:random_user/random_user.dart';
Version Uploaded Documentation Archive
0.3.0 Apr 8, 2019 Go to the documentation of random_user 0.3.0 Download random_user 0.3.0 archive
0.2.0 Mar 8, 2019 Go to the documentation of random_user 0.2.0 Download random_user 0.2.0 archive
0.1.0 Jan 22, 2019 Go to the documentation of random_user 0.1.0 Download random_user 0.1.0 archive
0.0.1 Jan 22, 2019 Go to the documentation of random_user 0.0.1 Download random_user 0.0.1 archive
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Apr 12, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.2.0
  • pana: 0.12.14


Detected platforms: Flutter, web, other

No platform restriction found in primary library package:random_user/random_user.dart.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
http ^0.12.0+1 0.12.0+2
Transitive dependencies
async 2.2.0
charcode 1.1.2
collection 1.14.11
http_parser 3.1.3
meta 1.1.7
path 1.6.2
pedantic 1.5.0
source_span 1.5.5
string_scanner 1.0.4
term_glyph 1.1.0
typed_data 1.1.6
Dev dependencies
test >=0.12.42 <2.0.0
test_coverage ^0.2.0