magicMap method
Converts the value to a Map.
defaultValue: The value to return if the conversion fails or the value isnull.
Implementation
Map magicMap({Map defaultValue = const {}}) {
if (isNull) return defaultValue;
if (this is Map) return this as Map;
if (this is List) {
Map<int, dynamic> resultMap = {};
for (var i = 0; i < (this as List).length; i++) {
resultMap[i] = (this as List)[i];
}
return resultMap;
}
return defaultValue;
}