ArrayConverter class

Converts arbitrary values into array objects.

Example

var value1 = ArrayConverter.toArray([1, 2]);		 // Result: [1, 2]
var value2 = ArrayConverter.toArray(1);			  // Result: [1]
var value2 = ArrayConverter.listToArray('1,2,3');	// Result: ['1', '2', '3']

Constructors

ArrayConverter()

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

listToArray(dynamic value) List
Converts value into array object with empty array as default. Strings with comma-delimited values are split into array of strings.
toArray(dynamic value) List
Converts value into array object with empty array as default. Single values are converted into arrays with single element.
toArrayWithDefault(dynamic value, List defaultValue) List
Converts value into array object with specified default. Single values are converted into arrays with single element.
toNullableArray(dynamic value) List?
Converts value into array object. Single values are converted into arrays with a single element.