fromPastLaunch static method
Static helper to build a ViewModel from a graphql response
Implementation
static SingleLaunchViewModel fromPastLaunch(
GetPastLaunches$Query$Launch gqlLaunch,
{bool clickable = true,
bool showTitle = true,
bool showImage = false}) =>
SingleLaunchViewModel(
id: gqlLaunch.id ?? "-1",
rocketName: gqlLaunch.rocket?.rocketName ?? "",
launchDate: _dateFormat.format(gqlLaunch.launchDateLocal!),
missionName: gqlLaunch.missionName ?? "Unknown",
clickable: clickable,
showTitle: showTitle,
showImage: showImage,
photos: gqlLaunch.links?.flickrImages?.whereType<String>().toList() ??
<String>[]);