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
orBigInt
. - PropertyMap
- A property map implements ValueAccessor interface for property access.
- StringOrInteger
-
An interface for a value representing
String
,int
orBigInt
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
toBigInt
or throws FormatException if cannot convert. [...] -
valueToBool(
dynamic value) → bool -
Converts
value
tobool
or throws FormatException if cannot convert. -
valueToDouble(
dynamic value, {double? min, double? max}) → double -
Converts
value
todouble
or throws FormatException if cannot convert. [...] -
valueToInt(
dynamic value, {int? min, int? max}) → int -
Converts
value
toint
or throws FormatException if cannot convert. [...] -
valueToString(
dynamic value) → String -
Converts
value
toString
or throws FormatException if cannot convert. -
valueToTimeMillisUTC(
dynamic value, {bool isUTCSource = false}) → DateTime -
Converts the
value
to aDateTime
value. [...] -
valueToTimeUTC(
dynamic value, {DateFormat? sourceFormat, bool isUTCSource = false}) → DateTime -
Converts the
value
to aDateTime
value. [...]
Exceptions / Errors
- ConversionException
-
A
FormatException
notifying about unsupported converion. - NullValueException
-
A
FormatException
notifying about null value. - UndefinedValueException
-
A
FormatException
notifying about undefined value.