fromPastLaunch static method

SingleLaunchViewModel fromPastLaunch(
  1. GetPastLaunches$Query$Launch gqlLaunch, {
  2. bool clickable = true,
  3. bool showTitle = true,
  4. bool showImage = false,
})

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>[]);