parseMapStringDynamic static method

Map<String, dynamic> parseMapStringDynamic(
  1. dynamic data,
  2. Map<String, dynamic> defaultValue
)

Implementation

static Map<String, dynamic> parseMapStringDynamic(
    dynamic data, Map<String, dynamic> defaultValue) {
  if (data == null) {
    return defaultValue;
  }
  try {
    Map<String, dynamic> map = data.cast<String, dynamic>();
    return map;
  } catch (e) {
    return defaultValue;
  }
}