getMapFromPayload static method
Implementation
static Map<String, dynamic> getMapFromPayload(Object? payload) {
if (payload is String) {
try {
return json.decode(payload);
} catch (e) {
return {};
}
}
if (payload is Map<String, dynamic>) return payload;
return {};
}