Uuid class Null safety

uuid for Dart Author: Yulian Kuncheff Released under MIT License.

Constructors

Uuid({Map<String, dynamic>? options})
const

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
options → dynamic
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
A string representation of this object. [...]
inherited
v1({Map<String, dynamic>? options}) String
v1() Generates a time-based version 1 UUID [...]
v1buffer(List<int> buffer, {Map<String, dynamic>? options, int offset = 0}) List<int>
v1buffer() Generates a time-based version 1 UUID [...]
v1obj({Map<String, dynamic>? options}) UuidValue
v1obj() Generates a time-based version 1 UUID [...]
v4({Map<String, dynamic>? options}) String
v4() Generates a RNG version 4 UUID [...]
v4buffer(List<int> buffer, {Map<String, dynamic>? options, int offset = 0}) List<int>
v4buffer() Generates a RNG version 4 UUID [...]
v4obj({Map<String, dynamic>? options}) UuidValue
v4obj() Generates a RNG version 4 UUID [...]
v5(String? namespace, String? name, {Map<String, dynamic>? options}) String
v5() Generates a namspace & name-based version 5 UUID [...]
v5buffer(String? namespace, String? name, List<int>? buffer, {Map<String, dynamic>? options, int offset = 0}) List<int>
v5buffer() Generates a RNG version 4 UUID [...]
v5obj(String? namespace, String? name, {Map<String, dynamic>? options}) UuidValue
v5obj() Generates a namspace & name-based version 5 UUID [...]

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited

Static Methods

isValidOrThrow({String fromString = '', Uint8List? fromByteList, ValidationMode validationMode = ValidationMode.strictRFC4122}) → void
isValidUUID({String fromString = '', Uint8List? fromByteList, ValidationMode validationMode = ValidationMode.strictRFC4122}) bool
Validates the provided uuid to make sure it has all the necessary components and formatting and returns a bool You can choose to validate from a string or from a byte list based on which parameter is passed.
parse(String uuid, {List<int>? buffer, int offset = 0, bool validate = true, ValidationMode validationMode = ValidationMode.strictRFC4122}) List<int>
Parses the provided uuid into a list of byte values as a List. Can optionally be provided a buffer to write into and a positional offset for where to start inputting into the buffer. Throws FormatException if the UUID is invalid. Optionally you can set validate to false to disable validation of the UUID before parsing.
parseAsByteList(String uuid, {List<int>? buffer, int offset = 0, bool validate = true, ValidationMode validationMode = ValidationMode.strictRFC4122}) Uint8List
Parses the provided uuid into a list of byte values as a Uint8List. Can optionally be provided a buffer to write into and a positional offset for where to start inputting into the buffer. Throws FormatException if the UUID is invalid. Optionally you can set validate to false to disable validation of the UUID before parsing.
unparse(List<int> buffer, {int offset = 0}) String
Unparses a buffer of bytes and outputs a proper UUID string. An optional offset is allowed if you want to start at a different point in the buffer. Throws an exception if the buffer does not have a length of 16

Constants

NAMESPACE_DNS → const String
'6ba7b810-9dad-11d1-80b4-00c04fd430c8'
NAMESPACE_NIL → const String
'00000000-0000-0000-0000-000000000000'
NAMESPACE_OID → const String
'6ba7b812-9dad-11d1-80b4-00c04fd430c8'
NAMESPACE_URL → const String
'6ba7b811-9dad-11d1-80b4-00c04fd430c8'
NAMESPACE_X500 → const String
'6ba7b814-9dad-11d1-80b4-00c04fd430c8'