ulid 1.0.3

  • Readme
  • Changelog
  • Example
  • Installing
  • 84

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.3 #

  • Fixed bit loss in browser's int handling.

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.3

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]
73
Health:
Code health derived from static analysis. [more]
90
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
84
Learn more about scoring.

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

  • Dart: 2.7.0
  • pana: 0.13.1+4

Health suggestions

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

Analysis of lib/ulid.dart reported 21 hints, including:

line 13 col 18: Unnecessary new keyword.

line 27 col 28: Unnecessary new keyword.

line 28 col 24: Unnecessary new keyword.

line 36 col 12: Unnecessary new keyword.

line 42 col 14: Unnecessary new keyword.

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