favoriteAsset method

Future<bool> favoriteAsset({
  1. required AssetEntity entity,
  2. required bool favorite,
})

Implementation

Future<bool> favoriteAsset({
  required AssetEntity entity,
  required bool favorite,
}) async {
  final result = await _plugin.favoriteAsset(entity.id, favorite);
  if (result) {
    entity.isFavorite = favorite;
  }
  return result;
}