toNullableMap static method

Map<String, dynamic>? toNullableMap(
  1. String? value
)

Converts JSON string into map object or returns null when conversion is not possible.

  • value the JSON string to convert. Returns Map object value or null when conversion is not supported.

See MapConverter.toNullableMap

Implementation

static Map<String, dynamic>? toNullableMap(String? value) {
  if (value == null) return null;

  try {
    var map = jsonDecode(value);
    return MapConverter.toNullableMap(map);
  } catch (e) {
    return null;
  }
}