getPatchNotes function Null safety

Future<List<MinecraftPatch>> getPatchNotes()

Returns a List of the most recent patch notes for Minecraft: Java Edition.

These can also be found in the official Minecraft Launcher under the "patch notes" page.

Implementation

Future<List<MinecraftPatch>> getPatchNotes() async {
  final response =
      await request(http.get, _launcherContentApi, 'javaPatchNotes.json');
  final data = parseResponseMap(response);
  final patches = <MinecraftPatch>[];
  for (Map<String, dynamic> e in data['entries']) {
    patches.add(MinecraftPatch.fromJson(e));
  }
  return patches;
}