MapExtensions extension

extension methods for Map

on

Properties

nullProtected Map<String, dynamic>

Available on Map, provided by the MapExtensions extension

Returns a new map with null keys or values removed
no setter

Methods

add<T>({required String? key, required T? value}) → T

Available on Map, provided by the MapExtensions extension

Add value to map if value is not null
getBool(String key, {bool defaultValue = defaultBool}) bool

Available on Map, provided by the MapExtensions extension

Reads a key value of bool type from Map.
getBoolWithDefaultValue(String key, {bool defaultValue = defaultBool}) bool

Available on Map, provided by the MapExtensions extension

Reads a key value of bool type from Map. If value is NULL or not bool type return default value defaultBool
getDouble(String key, {double defaultValue = defaultDouble}) double

Available on Map, provided by the MapExtensions extension

Reads a key value of double type from Map.
getInt(String key, {int defaultValue = defaultInt}) int

Available on Map, provided by the MapExtensions extension

Reads a key value of int type from Map.
getList(String key) List

Available on Map, provided by the MapExtensions extension

Reads a key value of List type from Map.
getMap(String key) Map

Available on Map, provided by the MapExtensions extension

Reads a key value of List type from Map.
getSDMap(String key) Map<String, dynamic>

Available on Map, provided by the MapExtensions extension

Reads a key value of Map<String, dynamic> type from Map.
getString(String key, {String defaultValue = defaultString}) String

Available on Map, provided by the MapExtensions extension

Reads a key value of String type from Map.
toJson() String

Available on Map, provided by the MapExtensions extension

Map to JSON usingjson.encode
toPretty() String

Available on Map, provided by the MapExtensions extension

Convert map to a String withIndent