min_id

Id generator for dart

Travis (.com) GitHub Pub Version GitHub repo size

Getting Start ✈

dependencies:
  min_id: ^1.0.3

Install it

flutter pub get
  • default format 🏮
import 'package:min_id/min_id.dart;

final id = MinId.getId();
print(id);// abc-qwe-rty-xzy
  • Custom format ✂
import 'package:min_id/min_id.dart;

final id = MinId.getId('{3d}-{3w}-xyz');
print(id);//128-bca-xyz
  • Custom global format 🌏
import 'package:min_id/min_id.dart;

MinId.withFormat('{3d}-{3w}-xyz');
final id = MinId.getId();
print(id);//128-bca-xyz

Document 📝

Syntax ⚔

SyntaxRangeDescriptionversion
abc___Return string abc^1.0.0
{d}0 - 9Pick random 1 character from 0 -> 9^1.0.0
{w}a - z or A - ZPick random 1 character from letter string^1.0.0
{.}0x0021 - 0x007fPick random 1 character from 0x0021 -> 0x007f in UTF8 charset^1.0.0
(abc)a - cPick random 1 character from a -> c (abc from input user)^1.0.0
{2(abc)}a - cPick random 2 characters from a -> c^1.0.0
{2{d}}0 - 9Pick random 2 character from 0 -> 9^1.0.0
(abc{d})a -> c or 0 - 9Nested random:
+ Step 1: Pick random 1 character in number range
+ Step 2: Pick random 1 character in a -> c or result in step 1
^1.0.0

Contributors

License

BSD 3-Clause @tvc12

Libraries

min_id