toMap method Null safety

Map<String, dynamic> toMap()

Implementation

Map<String, dynamic> toMap() {
  if (_sourceMap != null) return _sourceMap!;
  return {
    'code': code,
    'data': data,
    'msg': errorDetails,
  };
}