build method

  1. @override
dynamic build(
  1. dynamic context,
  2. dynamic ref
)

Implementation

@override
Widget build(BuildContext context, WidgetRef ref) {
  final isBookmarked = ref.watch(isBookmarkedProvider(bookmarker));

  if (isBookmarked) {
    return IconButton(
      onPressed: () => unbookmark(ref: ref, bookmarker: bookmarker),
      icon: const Icon(Icons.bookmark),
    );
  }

  return IconButton(
    icon: const Icon(Icons.bookmark_border),
    onPressed: () async => bookmark(ref: ref, bookmarker: bookmarker),
  );
}