toMap method
Implementation
Map<String, dynamic> toMap() => {
'@type': 'Review',
'author': {'@type': 'Person', 'name': author},
'reviewRating': {
'@type': 'Rating',
'ratingValue': ratingValue,
'bestRating': 5,
'worstRating': 1,
},
if (body != null) 'reviewBody': body,
if (datePublished != null) 'datePublished': datePublished,
if (reviewTitle != null) 'name': reviewTitle,
};