Package selection guidance compiled from public package information, community data, and project usage.
flutter_faker_plus is a Dart package that generates realistic fake data for testing and prototyping Flutter applications. It provides customizable random data such as user profiles, product details, and geolocation information. Ideal for developers who need to simulate real-world datasets without relying on actual backend services. The package supports multiple platforms including Android, iOS, Web, macOS, Windows, and Linux, making it versatile for cross-platform development. With an easy-to-use API and active maintenance, it streamlines the creation of mock content during app development.
Use cases
Testing UI components with sample data
Prototyping apps with realistic dummy content
Populating forms with randomized inputs
Simulating e-commerce product catalogs
Generating test user accounts
Creating mock geolocation data
Key features
Supports user profile generation
Generates product and e-commerce data
Provides geolocation and address info
Cross-platform compatibility
Easy integration via pub.dev
Customizable data templates
Suitable for
Flutter developers in early-stage prototyping
Testers needing consistent dummy data
Teams building demo versions of apps
Educational projects requiring sample datasets
Developers working on UI/UX design mockups
Considerations
Not intended for production data
Data is randomly generated and not unique across runs
Limited customization beyond basic settings
Depends on external GitHub repository
May require updates for new Flutter versions
Original README
Original README snapshot from the linked source repository. Visit the repository for the latest content.
flutter_faker_plus
A comprehensive fake data generator for Flutter/Dart applications.
🚀 Features
User Profiles: Generate random user profiles with:
Name
Email
Phone number
Address
Date of birth
Gender
Profile picture URL
Bio
E-commerce Products: Create random product data including:
Product name
Price
Category
Geolocation: Generate random latitude and longitude coordinates.
Lorem Ipsum: Added Lorem Ipsum placeholder text.
Future Plans:
Add image URLs for e-commerce products.
Support additional fake data types.
Implement a fake QR code generator.
Flutter Faker Data Generator Example
This example demonstrates how to generate fake user, product, and location data using the flutter_faker_plus library in Flutter.
voidmain() {
WidgetsFlutterBinding.ensureInitialized();
// Register all mock routessetupMockServer();
runApp(constFakeDataApp());
}
classFakeDataAppextendsStatelessWidget{
constFakeDataApp({super.key});
@overrideWidgetbuild(BuildContext context) {
// Generate fake user, product, and location data using flutter_faker_plus.finalUserProfile user =
UserProfile.generate(); // Generate a fake user profile.finalEcommerceProduct product =
EcommerceProduct.generate(); // Generate a fake e-commerce product.finalGeoLocation location =
GeoLocation.generate(); // Generate a fake geo-location.finalLoremIpsum loremIpsum = LoremIpsum();
returnMaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text('Fake Data Generator Example'),
),
body: SingleChildScrollView(
child: Padding(
padding: constEdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('User Profile:', style: TextStyle(fontSize: 20)),
// Displays a heading for the user profile section.Text('Name: ${user.name}'),
// Displays the generated user's name.Text('Email: ${user.email}'),
// Displays the generated user's email.Text('Phone: ${user.phoneNumber}'),
// Displays the generated user's phone number.Text('Address: ${user.address}'),
// Displays the generated user's address.Text('Date of Birth: ${user.dateOfBirth}'),
// Displays the generated user's date of birth.Text('Gender: ${user.gender}'),
// Displays the generated user's gender.Image.network(user.profilePictureUrl),
// Displays the user's profile picture from a network URL.Text('Bio: ${user.bio}'),
// Displays the generated user's bio.SizedBox(height: 20),
// Adds vertical spacing of 20 pixels.Text('E-Commerce Product:', style: TextStyle(fontSize: 20)),
// Displays a heading for the product section.Text('Product: ${product.name}'),
// Displays the product name.Text('Category: ${product.category}'),
// Displays the product category.Text('Price: \$${product.price}'),
// Displays the product price prefixed with a dollar sign.SizedBox(height: 20),
// Adds vertical spacing of 20 pixels.Text('Geo-Location:', style: TextStyle(fontSize: 20)),
// Displays a heading for the geo-location section.Text('Latitude: ${location.latitude}'),
// Displays the generated latitude.Text('Longitude: ${location.longitude}'),
// Displays the generated longitude.SizedBox(height: 20),
// Adds vertical spacing of 20 pixels.Text('Lorem Ipsum:', style: TextStyle(fontSize: 20)),
Text(
loremIpsum.generate(words: 20),
),
SizedBox(height: 5),
Text(
loremIpsum.generate(
words: 60, paragraphs: 3, showLoremIpsum: true),
),
SizedBox(
height: 600,
child: UserPage())
],
),
),
),
),
);
}
}
🧪 Mock API Requests
flutter_faker_plus comes with a mock backend server for testing without a real API.