isBookmarked function

  1. @riverpod
Future<bool> isBookmarked(
  1. Ref<Object?> ref, {
  2. required BookmarkKind kind,
  3. required String targetId,
})

Whether the current user has bookmarked the given target. Used by BookmarkButton to flip between filled and outlined glyph.

Implementation

@riverpod
Future<bool> isBookmarked(
  Ref ref, {
  required BookmarkKind kind,
  required String targetId,
}) async {
  final ds = ref.watch(supabaseDatasourceProvider);
  return ds.isBookmarked(kind: kind, targetId: targetId);
}