패키지, 저장소 및 앱 카테고리 검색

패키지 상세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
  • 경량이고 빠름
  • 확장 가능한 데이터 생성
  • 내장 지역 설정 지원

적합한 대상

  • 테스터 및 품질보증 엔지니어
  • 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 개

소스 저장소

이 패키지를 사용하는 프로젝트