ulid 1.0.2

Ulid implementation in Dart #

Lexicographically sortable, 128-bit identifier (UUID) with 48-bit timestamp and 80 random bits. Canonically encoded as a 26 character string, as opposed to the 36 character UUID.

Original implementation: https://github.com/alizain/ulid/

Usage #

A simple usage example:

import 'package:ulid/ulid.dart';

main() {
  print(new Ulid());
  print(new Ulid().toUuid());
}

Changelog #

1.0.2 #

  • Using package:pedantic.
  • Removed leftover main method.

1.0.1 #

  • Declared support for Dart 2.
  • Upgraded dependencies.

1.0.0 #

  • First public version.

example/main.dart

// Copyright (c) 2017, Agilord. All rights reserved. Use of this source code
// is governed by a BSD-style license that can be found in the LICENSE file.

import 'package:ulid/ulid.dart';

void main() {
  print(new Ulid());
  print(new Ulid().toUuid());
}

Use this package as a library

1. Depend on it

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


dependencies:
  ulid: ^1.0.2

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:ulid/ulid.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
63
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
81
Learn more about scoring.

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

  • Dart: 2.4.0
  • pana: 0.12.19

Platforms

Detected platforms: Flutter, web, other

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

Health suggestions

Fix lib/ulid.dart. (-0.50 points)

Analysis of lib/ulid.dart reported 1 hint:

line 49 col 9: DO use curly braces for all flow control structures.

Dependencies

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