short_readable_id 1.5.1

  • Installing
  • Versions
  • new50

short_readable_id #

A short human readable and easily memorable unique id generator.

Generating short human readable id #

void main() {
  print(idGenerator.generateReadable());  // => VVGU-976

Configuring separator #

Use separator parameter to configure the separator used between alphabetical and numerical parts of the id.

void main() {
  print(idGenerator.generateReadable(separator: ''));  // => VVGU976

Generating short id #

void main() {
  print(idGenerator.generate());  // => 1YQOBQO

Choose date reference #

The parameter refDate lets the programmer configure reference date that is used to generate a part of the generated id. The most recent date you pick, the shorter will be the generated id.

void main() {
  final gen = IdGenerator(refDate: DateTime(2050));

Worker id #

Worker id is used to generate the id to make sure ids generated by multiple concurrent id generators do not conflict. Configure worker id using workerId parameter.

void main() {
  final gen = IdGenerator(workerId: 5);

1.0.0 #

  • Initial version, created by Stagehand

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  short_readable_id: ^1.5.1

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:short_readable_id/short_readable_id.dart';
Version Uploaded Documentation Archive
1.5.1 Mar 5, 2019 Go to the documentation of short_readable_id 1.5.1 Download short_readable_id 1.5.1 archive
1.5.0 Mar 5, 2019 Go to the documentation of short_readable_id 1.5.0 Download short_readable_id 1.5.0 archive
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Mar 6, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.2.0
  • pana: 0.12.14


Detected platforms: Flutter, web, other

No platform restriction found in primary library package:short_readable_id/short_readable_id.dart.

Health suggestions

Fix lib/src/id.dart. (-0.50 points)

Analysis of lib/src/id.dart reported 1 hint:

line 108 col 10: The method '_format16' isn't used.

Maintenance suggestions

Maintain an example.

None of the files in the package's example/ directory matches known example patterns.

Common filename patterns include main.dart, example.dart, and short_readable_id.dart. Packages with multiple examples should provide example/

For more information see the pub package layout conventions.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
Dev dependencies
pedantic ^1.0.0
test ^1.0.0