attributes library Null safety

Data structures for identifiers, value maps and dynamic data objects.

Usage: import package:attributes/attributes.dart

Classes

Counted
An interface for a collection with countable items.
Entity
An entity is a data object with optional id and required properties.
EntityBase
An immutable base implementation of Entity.
Identifier
An identifier of something, represented as String, int or BigInt.
PropertyMap
A property map implements ValueAccessor interface for property access.
StringOrInteger
An interface for a value representing String, int or BigInt data. [...]
ValueAccessor<K>
An interface to access typed values from a value map by keys of type K. [...]

Mixins

ValueAccessorMixin<K>
A mixin implementing all but three of the methods of ValueAccessor. [...]

Functions

valueToBigInt(dynamic value, {BigInt? min, BigInt? max}) → BigInt
Converts value to BigInt or throws FormatException if cannot convert. [...]
valueToBool(dynamic value) → bool
Converts value to bool or throws FormatException if cannot convert.
valueToDouble(dynamic value, {double? min, double? max}) → double
Converts value to double or throws FormatException if cannot convert. [...]
valueToInt(dynamic value, {int? min, int? max}) → int
Converts value to int or throws FormatException if cannot convert. [...]
valueToString(dynamic value) → String
Converts value to String or throws FormatException if cannot convert.
valueToTimeMillisUTC(dynamic value, {bool isUTCSource = false}) → DateTime
Converts the value to a DateTime value. [...]
valueToTimeUTC(dynamic value, {DateFormat? sourceFormat, bool isUTCSource = false}) → DateTime
Converts the value to a DateTime value. [...]

Exceptions / Errors

ConversionException
A FormatException notifying about unsupported converion.
NullValueException
A FormatException notifying about null value.
UndefinedValueException
A FormatException notifying about undefined value.