clearRoom method
Used to delete ALL the entities from a specific room.
Parameters:
roomType
this will define which room will be cleaned.playlistKey
this will be the id/key of the playlist*
.
*
playlistKey
it's only required when using RoomType.PLAYLIST.
Return:
- If the room was cleaned, will return
true
, if not, will returnfalse
.
See too:
Implementation
Future<bool> clearRoom(RoomType roomType, {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.clearController(
roomType,
playlistKey: playlistKey,
);
}