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.
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.
random_user
is released under an MIT License. See LICENSE
for details.