deleteFrom method
Used to delete a specific song(entity) from a specific room.
Parameters:
roomType
this will define which room the entity will be deleted.entityKey
this is the key of the song that will be deleted.playlistKey
this will be the id/key of the playlist*
.
*
playlistKey
it's only required when using RoomType.PLAYLIST.
Return:
- If the song was deleted, will return
true
, if not, will returnfalse
.
See too:
Implementation
Future<bool> deleteFrom(
RoomType roomType,
int entityKey, {
int? playlistKey,
}) async {
if (roomType == RoomType.PLAYLIST && playlistKey == null) {
throw Exception(
"Cannot add [entity] to a undefined [playlist]\n"
"Define the [playlistKey] parameter.",
);
}
return await _controller.deleteFromController(
roomType,
entityKey,
playlistKey: playlistKey,
);
}