toMap method Null safety

  1. @override
Map<String, dynamic> toMap()

Convert this object to a JSON string.

Implementation

@override
Map<String, dynamic> toMap() {
  return {
    if (platform != null) 'platform': platform,
    if (versionString != null) 'versionString': versionString,
    if (appStoreState != null) 'appStoreState': appStoreState,
    if (copyright != null) 'copyright': copyright,
    if (releaseType != null) 'releaseType': releaseType.toString(),
    if (earliestReleaseDate != null)
      'earliestReleaseDate': earliestReleaseDate?.toIso8601String(),
    if (downloadable != null) 'downloadable': downloadable,
    if (createdDate != null) 'createdDate': createdDate?.toIso8601String(),
  };
}