getAllAlbums method Null safety

Future<void> getAllAlbums()

Loads the list of all available albums.

Implementation

Future<void> getAllAlbums() async {
  emit(
    const AlbumsState.inProgress(),
  );

  final result = await _getAllAlbums();

  emit(
    result.when(
      AlbumsState.success,
      failure: AlbumsState.failure,
    ),
  );
}