asMap function

Map<String, dynamic> asMap(
  1. dynamic value
)

Implementation

Map<String, dynamic> asMap(dynamic value){
  try{
    if(value is Map<String, dynamic>){
      return value;
    }
    return jsonDecode(value);
  }catch(e){
    logNUI("NUIEnt", "Failed to decode json of value : $value");
    return {};
  }
}