PublishableMapper class final

A utility class that provides methods to map dynamic values to their respective types.

Constructors

PublishableMapper()
Creates a new instance of PublishableMapper.
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

$bool(Object? value) → bool
Maps a value to a boolean.
$DateTime(Object? value) → DateTime?
Maps a value to a DateTime.
$double(Object? value) → double
Maps a value to a double.
$EnumIndexed<T extends Enum>(Object? index, {required List<T> values, T? orElse}) → T
Maps a value to an enum by index.
$EnumNamed<T extends Enum>(Object? name, {required List<T> values, T? orElse}) → T
Maps a value to an enum by name.
$int(Object? value) → int
Maps a value to an integer.
$List<T>(Object? value, T converter(Object?)) → List<T>
Maps a value to a list of items.
$Map(Object? value) → Map<String, dynamic>
Maps a value to a map.
$String(Object? value) → String
Maps a value to a string.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

decode(String json) → Map<String, dynamic>
Decodes a JSON string to a map.
decodeAs<T>(String json, {required T fromMap(Map<String, dynamic>)}) → T
Decodes a JSON string to a value of type T.
decodeList(String json) → List<Map<String, dynamic>>
Decodes a JSON string to a list of maps.
decodeListAs<T>(String json, {required T fromMap(Map<String, dynamic>)}) → List<T>
Decodes a JSON string to a list of values of type T.