Convert class

A set of methods for converting various types of values.

Constructors

Convert()

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

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

toBoolean(dynamic d, bool def) bool
Converts a dynamic value to a non-nullable boolean.
toBooleanN(dynamic d) bool?
Converts a dynamic value to a nullable boolean.
toDateTime(dynamic d, DateTime def, {TimeUnit unit = TimeUnit.seconds}) DateTime
Converts a dynamic value to a non-nullable DateTime.
toDateTimeN(dynamic d, {TimeUnit unit = TimeUnit.seconds}) DateTime?
Converts a dynamic value to a nullable DateTime.
toDouble(dynamic d, double def) double
Converts a dynamic value to a non-nullable double.
toDoubleN(dynamic d) double?
Converts a dynamic value to a nullable double.
toInt(dynamic d, int def) int
Converts a dynamic value to a non-nullable integer.
toIntN(dynamic d) int?
Converts a dynamic value to a nullable integer.
toList<T>(dynamic d, List<T> def) List<T>
Converts a dynamic value to a non-nullable list.
toListN<T>(dynamic d) List<T>?
Converts a dynamic value to a nullable list.
toListOfDouble(dynamic d) List<double>
Converts a dynamic value to a non-nullable list of doubles.
toListOfInt(dynamic d) List<int>
Converts a dynamic value to a non-nullable list of integers.
toListOfString(dynamic d) List<String>
Converts a dynamic value to a non-nullable list of strings.
toMap<T1, T2>(dynamic d, Map<T1, T2> def) Map<T1, T2>
Converts a dynamic value to a non-nullable map.
toMapN<T1, T2>(dynamic d) Map<T1, T2>?
Converts a dynamic value to a nullable map.
toMapOfStringDouble(dynamic d, Map<String, double> def) Map<String, double>
Converts a dynamic value to a non-nullable map of <String, double>.
toMapOfStringDoubleN(dynamic d) Map<String, double>?
Converts a dynamic value to a nullable map of <String, double>.
toMapOfStringString(dynamic d, Map<String, String> def) Map<String, String>
Converts a dynamic value to a non-nullable map of <String, String>.
toMapOfStringStringN(dynamic d) Map<String, String>?
Converts a dynamic value to a nullable map of <String, String>.
toStr(dynamic d, String def) String
Converts a dynamic value to a non-nullable String.
toStrN(dynamic d) String?
Converts a dynamic value to a nullable String.