パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v0.2.3

faker_dart

DartおよびFlutterで大量の偽データを生成します!人気のあるfaker.jsのDart版

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
1.1万
いいね数
96
Pub ポイント
160

パッケージをインストール

flutter pub add faker_dart

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

Faker Dart は人気のある faker.js ライブラリの Dart版であり、FlutterおよびDartアプリケーションでのテストや開発用途に、大量の現実的な偽データを生成できるようにします。名前、住所、メールアドレス、電話番号、ローレム・イプサムテキストなど、幅広いデータタイプをサポートしています。使いやすさを重視した設計で、複数のプラットフォームにおけるテストワークフローにスムーズに統合できます。モックデータベースの埋め込み、サンプルUIの作成、またはリアルなデータに依存せずにユーザー入力をシミュレートする場合に最適です。

用途

  • テストデータベースのポピュレーション
  • モックUIデータの生成
  • サンプルユーザーのプロフィールを作成する
  • API応答のシミュレーション
  • フォーム検証のテスト
  • ダミー コンテンツを使用したストレス テスト

主な機能

  • 複数のデータ型をサポートしています
  • クロスプラットフォーム互換性
  • シンプルで直感的な API
  • 軽量で高速
  • 拡張可能なデータ生成
  • 組み込みロケールサポート

適している対象

  • テスト担当者およびQAエンジニア
  • Flutter開発者
  • バックエンド開発者
  • UI/UXデザイナー
  • プロトタイピングチーム
  • データシミュレーションプロジェクト

注意事項

  • 本番データには適していません
  • 生成されたデータは本物ではありません
  • ロケールの設定が必要になる場合があります
  • 制限されたカスタマイズオプション
  • 組み込みのデータ永続化なし
  • 外部のGitHubリポジトリに依存しています

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

Pub Version Likes Pub points Pub Pub codecov

generate massive amounts of fake data in Dart & Flutter

Faker.dart is a dart port of the famous faker.js package for the web and NodeJS

:hammer: Usage

faker.dart is split up into modules, where every module has a bunch of faker methods.

Basics
    final faker = Faker.instance;

    String randomName = faker.name.fullName(); // Rowan Nikolaus
    String randomHex = faker.datatype.hexaDecimal(); // 0xF74451AB
Faker.fake()

faker.dart contains a super useful generator method Faker.fake for combining faker API methods using a mustache string format.

Example:

print(faker.fake("{{name.lastName}}, {{name.firstName}} {{name.suffix}}"));
// outputs: "Marks, Dean Sr."

This will interpolate the format string with the value of methods name.lastName(), name.firstName(), and name.suffix()

supported faker methods
Module Methods
datatype number, float, datetime, string, uuid, boolean, hexaDecimal, json, list
name fullName, firstName, lastName, middleName, findName, jobTitle, gender, prefix, suffix, title, jobDescriptor, jobArea, jobType
image image, loremPicsum, lorempixel
address zipCode, city, cityPrefix, citySuffix, cityName, streetName, streetSuffix, streetPrefix, streetAddress, secondaryAddress, county, country, countryCode, state, stateAbbr, latitude, longitude, direction, cardinalDirection, ordinalDirection, nearbyGPSCoordinate, timezone
animal type, animal, dog, cat, snake, bear, lion, catecean, horse, bird, cow, fish, corocodilia, insect, rabbit
commerce color, department, productName, price, productAdjective, productMaterial, product, productDescription
company companyName, companySuffix, catchPhrase, bs, catchPhraseAdjective, catchPhraseDescriptor, catchPhraseNoun, bsAdjective, bsBuzz, bsNoun
database column, type, collation, engine
music genre
hacker abbreviation, adjective, noun, verb, ingverb, phrase
git branch, commitEntry, commitMessage, commitSha, shortSha
date past, future, between, month, weekday
phoneNumber phoneNumber, phoneFormat
lorem word, sentence, paragraph, text
internet url, domainName, domainSuffix, httpMethod, ip, email

:speech_balloon: Localization

faker.dart currently supports 54 Locales!!!

The default language locale is set to English. if your chosen locale doesn't support specific faker data, it will fall back to the English locale.

// sets locale to german
faker.setLocale(FakerLocaleType.de);
// set the locale to your custom Locale:
final FakerLocale locale = FakerLocale(...);
faker.setCustomLocale(locale);
currently internally supported locales:
  • az
  • ar
  • cz
  • de
  • de_AT
  • de_CH
  • en
  • en_AU
  • en_AU_ocker
  • en_BORK
  • en_CA
  • en_GB
  • en_IE
  • en_IND
  • en_US
  • en_ZA
  • es
  • es_MX
  • fa
  • fi
  • fr
  • fr_CA
  • fr_CH
  • ge
  • hy
  • hr
  • id_ID
  • it
  • ja
  • ko
  • nb_NO
  • ne
  • nl
  • nl_BE
  • pl
  • pt_BR
  • pt_PT
  • ro
  • ru
  • sk
  • sv
  • tr
  • uk
  • vi
  • zh_CN
  • zh_TW

:grey_question: what's up next

this package is still in active development. modules are still being added:

  • finance
  • system
  • vehicle
  • word

:wave: Get Involved

If this package is useful to you please :thumbsup: on pub.dev and :star: on Github. If you have any Issues, recommendations or pull requests I'd love to see them!

カテゴリー

依存関係

依存関係一覧 1 件

ソースリポジトリ

このパッケージを使用しているプロジェクト