How to quickly generate some fake data when building Flutter UIs

Are you building some UI in Flutter and need to show some temporary data?

The faker package makes this super easy!

You can use it to generate addresses, names, food, dates, sports... you name it!

Here's an example:

import 'package:faker/faker.dart'; void main() { final faker = Faker(); faker.internet.email(); // francisco_lebsack@buckridge.com faker.internet.ipv6Address(); // 2450:a5bf:7855:8ce9:3693:58db:50bf:a105 faker.internet.userName(); // fiona-ward faker.person.name(); // Fiona Ward faker.person.prefix(); // Mrs. faker.person.suffix(); // Sr. faker.lorem.sentence(); // Nec nam aliquam sem et }

Note: new random data will be generated every time a new Faker() object is created, including when you hot-reload and hot-restart.

Happy coding!

Want More?

Invest in yourself with my high-quality Flutter courses.

The Complete Dart Developer Guide

The Complete Dart Developer Guide

Learn Dart Programming in depth. Includes: basic to advanced topics, exercises, and projects. Fully updated to Dart 2.15.

Flutter Animations Masterclass - Full Course

Flutter Animations Masterclass - Full Course

Master Flutter animations and build a completely custom habit tracking application.

Flutter & Firebase Course: Build a Complete App for iOS & Android

Flutter & Firebase Course: Build a Complete App for iOS & Android

A full course with in-depth content, taking you from the basics all the way up to more advanced topics.

Flutter REST API Crash Course

Flutter REST API Crash Course

Build a Coronavirus Tracking App, and learn how to use REST APIs in Flutter.

Get the best Flutter tutorials, right in your inbox.

Join over 16,000 developers who receive my weekly Flutter email course & newsletter:

No spam, ever. Unsubscribe at any time.