build method
- dynamic context,
- 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),
);
}