Map<String, dynamic> toJson() { final map = <String, dynamic>{}; map['code'] = code; if (context != null) { map['context'] = context; } return map; }