Map<String, dynamic> toJson() { final titleMap = title.map( (key, value) => MapEntry(key.toJson(), value), ); return { 'title': titleMap, 'value': value, 'discount': discount?.toJson(), }; }