releaseNotes method

String? releaseNotes(
  1. Document response
)

Returns field releaseNotes from Play Store results. When there are no release notes, the main app description is used.

Implementation

String? releaseNotes(Document response) {
  try {
    final sectionElements = response.getElementsByClassName('W4P4ne');
    final releaseNotesElement = sectionElements.firstWhere(
        (elm) => elm.querySelector('.wSaTQd')!.text == 'What\'s New',
        orElse: () => sectionElements[0]);

    final rawReleaseNotes = releaseNotesElement
        .querySelector('.PHBdkd')
        ?.querySelector('.DWPxHb');
    final releaseNotes = rawReleaseNotes == null
        ? null
        : multilineReleaseNotes(rawReleaseNotes);

    return releaseNotes;
  } catch (e) {
    return redesignedReleaseNotes(response);
  }
}