The IdGen is a simple unique ID generator. It uses sequential ids.

Furthermore, IdGen is a singleton. Every instance will reference the same generator.

Usage example:

var id = new IdGen().nextId(); // 1
id = new IdGen().nextId(); // 2

Constructors

IdGen()

Returns always the same instance of the IdGenerator in the context of an application.

factory

Properties

hashCode → int

Get a hash code for this object.

read-only, inherited
runtimeType → Type

A representation of the runtime type of the object.

read-only, inherited

Operators

operator ==(other) → bool

The equality operator.

inherited

Methods

nextId() → int

Returns the next unique id.

noSuchMethod(Invocation invocation) → dynamic

Invoked when a non-existent method or property is accessed.

inherited
toString() → String

Returns a string representation of this object.

inherited