सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।
flutter_faker_plus एक Dart पैकेज है जो टेस्टिंग और प्रोटोटाइपिंग के लिए वास्तविक झूठे डेटा उत्पन्न करता है। यह उपयोगकर्ता प्रोफ़ाइल, उत्पाद विवरण और स्थान जानकारी जैसे कस्टमाइज़ेबल यादृच्छिक डेटा प्रदान करता है। वास्तविक दुनिया के डेटासेट को बिना वास्तविक बैकएंड सेवाओं पर निर्भर हुए सिमुलेट करने की आवश्यकता वाले डेवलपर्स के लिए आदर्श है। पैकेज में Android, iOS, Web, macOS, Windows और Linux जैसे कई प्लेटफॉर्म का समर्थन है, जिससे यह क्रॉस-प्लेटफॉर्म विकास के लिए लचीला बनता है। आसान उपयोग वाले API और सक्रिय रखरखाव के साथ, यह ऐप विकास के दौरान मॉक कंटेंट के निर्माण को सरल बनाता है।
उपयोग
नमूना डेटा के साथ UI घटकों का परीक्षण करें
वास्तविक डमी सामग्री के साथ एप्प्स का प्रोटोटाइपिंग
यादृच्छिक इनपुट के साथ फॉर्म भरना
ई-कॉमर्स उत्पाद कैटलॉग का नकली बनाना
परीक्षण उपयोगकर्ता खाते बनाना
मॉक जियोलोकेशन डेटा बनाना
मुख्य विशेषताएँ
उपयोगकर्ता प्रोफ़ाइल जनरेशन का समर्थन करता है
उत्पाद और ई-कॉमर्स डेटा उत्पन्न करता है
ज्योग्राफिक स्थिति और पता की जानकारी प्रदान करता है
प्लेटफॉर्म के अनुकूलता
pub.dev के माध्यम से आसान एकीकरण
कस्टमाइज़ किए जा सकने वाले डेटा प्रारूप
इनके लिए उपयुक्त
प्रारंभिक चरण के प्रोटोटाइपिंग में Flutter विकासकर्ता
स्थिर डमी डेटा की आवश्यकता वाले टेस्टर्स
एप्प्स के डेमो संस्करण बना रहे टीम
नमूना डेटासेट की आवश्यकता वाले शैक्षिक प्रोजेक्ट
UI/UX डिज़ाइन मॉकअप पर काम कर रहे विकासकर्ता
विचार योग्य बातें
उत्पादन डेटा के लिए नहीं बनाया गया है
डेटा यादृच्छिक रूप से उत्पन्न किया जाता है और चलानों के बीच अद्वितीय नहीं होता है
मूलभूत सेटिंग्स के अलावा सीमित कस्टमाइज़ेशन
बाहरी GitHub भंडार पर निर्भर करता है
नए Flutter संस्करण के लिए अपडेट की आवश्यकता हो सकती है
मूल README
संबंधित सोर्स रिपॉज़िटरी के मूल README का स्नैपशॉट। नवीनतम सामग्री के लिए रिपॉज़िटरी देखें।
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.