MapExtension extension
Methods
-
isNull(
String name) → bool -
Available on Map<
Returns true if this object has no mapping for {@code name} or if it has a mapping whose value is {@link #NULL}.String, dynamic> ?, provided by the MapExtension extension -
mapNotNull<
T> (T transform(String, dynamic)) → List< T> -
Available on Map<
Returns a list containing the results of applying the given transform function to each element in the original Map. If the tranform returnsString, dynamic> ?, provided by the MapExtension extensionnull
, it is not included in the output list. -
opt(
String name) → dynamic -
Available on Map<
Returns the value mapped by {@code name}, or null if no such mapping exists.String, dynamic> ?, provided by the MapExtension extension -
optBoolean(
String name, {bool fallback = false}) → bool -
Available on Map<
Returns the value mapped by {@code name} if it exists and is a boolean or can be coerced to a boolean, or {@code fallback} otherwise.String, dynamic> ?, provided by the MapExtension extension -
optDouble(
String name, {double fallback = double.nan}) → double -
Available on Map<
Returns the value mapped by {@code name} if it exists and is a double or can be coerced to a double, or {@code fallback} otherwise.String, dynamic> ?, provided by the MapExtension extension -
optInt(
String name, {int fallback = 0}) → int -
Available on Map<
Returns the value mapped by {@code name} if it exists and is an int or can be coerced to an int, or {@code fallback} otherwise.String, dynamic> ?, provided by the MapExtension extension -
optJSONArray(
String name) → List? -
Available on Map<
Returns the value mapped by {@code name} if it exists and is a {@code JSONArray}, or null otherwise.String, dynamic> ?, provided by the MapExtension extension -
optJSONObject(
String name) → Map< String, dynamic> ? -
Available on Map<
Returns the value mapped by {@code name} if it exists and is a {@code Map}, or null otherwise.String, dynamic> ?, provided by the MapExtension extension -
optNullableBoolean(
String name, {bool remove = false}) → bool? -
Available on Map<
Returns the value mapped byString, dynamic> ?, provided by the MapExtension extensionname
if it exists, coercing it if necessary, ornull
if no such mapping exists. Ifremove
is true, then the mapping will be removed from the Map. -
optNullableDouble(
String name, {bool remove = false}) → double? -
Available on Map<
Returns the value mapped byString, dynamic> ?, provided by the MapExtension extensionname
if it exists, coercing it if necessary, ornull
if no such mapping exists. Ifremove
is true, then the mapping will be removed from the Map. -
optNullableInt(
String name, {bool remove = false}) → int? -
Available on Map<
Returns the value mapped byString, dynamic> ?, provided by the MapExtension extensionname
if it exists, coercing it if necessary, ornull
if no such mapping exists. Ifremove
is true, then the mapping will be removed from the Map. -
optNullableString(
String name, {bool remove = false}) → String? -
Available on Map<
Returns the value mapped byString, dynamic> ?, provided by the MapExtension extensionname
if it exists, coercing it if necessary, ornull
if no such mapping exists. Ifremove
is true, then the mapping will be removed from the Map. -
optPositiveDouble(
String name, {double fallback = -1.0, bool remove = false}) → double? -
Available on Map<
Returns the value mapped byString, dynamic> ?, provided by the MapExtension extensionname
if it exists and is a positive double or can be coerced to a positive double, orfallback
otherwise. Ifremove
is true, then the mapping will be removed from the Map. -
optPositiveInt(
String name, {int fallback = -1, bool remove = false}) → int? -
Available on Map<
Returns the value mapped byString, dynamic> ?, provided by the MapExtension extensionname
if it exists and is a positive integer or can be coerced to a positive integer, orfallback
otherwise. Ifremove
is true, then the mapping will be removed from the Map. -
optString(
String name, {String fallback = ""}) → String -
Available on Map<
Returns the value mapped by {@code name} if it exists, coercing it if necessary, or {@code fallback} if no such mapping exists.String, dynamic> ?, provided by the MapExtension extension -
optStringsFromArrayOrSingle(
String name, {bool remove = false}) → List< String> -
Available on Map<
Returns the value mapped byString, dynamic> ?, provided by the MapExtension extensionname
if it exists and is either a List of String or a single String value, or an empty list otherwise. Ifremove
is true, then the mapping will be removed from the Map. -
put(
String name, dynamic object) → void -
Available on Map<
String, dynamic> ?, provided by the MapExtension extension -
putIterableIfNotEmpty(
String name, Iterable? collection) → void -
Available on Map<
MapsString, dynamic> ?, provided by the MapExtension extensionname
tocollection
after wrapping it in a List, clobbering any existing name/value mapping with the same name. If the collection is empty, any existing mapping forname
is removed. If the objects incollection
are JSONable, then they are converted to Map first. -
putJSONableIfNotEmpty(
String name, JSONable? jsonable) → void -
Available on Map<
MapsString, dynamic> ?, provided by the MapExtension extensionname
tojsonable
after converting it to a Map, clobbering any existing name/value mapping with the same name. If the Map argument is empty, any existing mapping forname
is removed. -
putMapIfNotEmpty(
String name, Map< String, dynamic> map) → void -
Available on Map<
MapsString, dynamic> ?, provided by the MapExtension extensionname
tomap
after wrapping it in a Map, clobbering any existing name/value mapping with the same name. If the map is empty, any existing mapping forname
is removed. If the objects inmap
are JSONable, then they are converted to Map first. -
putObjectIfNotEmpty(
String name, Map< String, dynamic> ? jsonObject) → void -
Available on Map<
MapsString, dynamic> ?, provided by the MapExtension extensionname
tojsonObject
, clobbering any existing name/value mapping with the same name. If the Map is empty, any existing mapping forname
is removed. -
putOpt(
String? name, Object? value) → void -
Available on Map<
String, dynamic> ?, provided by the MapExtension extension