short_readable_id 1.5.1

  • Readme
  • Changelog
  • Installing
  • 61

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 pub get

Alternatively, your editor might support pub get or flutter pub 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';
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 Apr 8, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6

Health suggestions

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

Analysis of lib/src/id.dart reported 5 hints:

line 46 col 7: DO use curly braces for all flow control structures.

line 73 col 7: DO use curly braces for all flow control structures.

line 103 col 7: DO use curly braces for all flow control structures.

line 105 col 7: DO use curly braces for all flow control structures.

line 108 col 10: The declaration '_format16' isn't referenced.

Maintenance suggestions

Package is getting outdated. (-9.32 points)

The package was last published 57 weeks ago.

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