updateCount method

Future<bool> updateCount(
  1. int key, {
  2. bool automatic = true,
  3. int? newCount,
})

Used to update the count of listened songs.

Parameters:

  • key this is the key of the song that will be updated.
  • automatic this will define if the count will be increased automatically.
  • newCount this will define the new count.

Important:

  • If automatic is null, will be set to true.
  • If automatic is false and newCount is null, will throw a error.

Return:

  • If the song(entity) was updated, will return true, if not, will return false.

Implementation

Future<bool> updateCount(int key, {bool automatic = true, int? newCount}) {
  if (automatic == false && newCount == null) return throw "";
  return _MostPlayedDao().updateCount(key, automatic, newCount);
}