Added share and unshare bookmarks

This commit is contained in:
Juan Gilsanz Polo
2024-02-27 18:20:00 +01:00
parent 5ab3b59152
commit 3f298cc22d
17 changed files with 390 additions and 9 deletions

View File

@@ -128,4 +128,17 @@ class Bookmarks extends _$Bookmarks {
ref.notifyListeners();
}
}
void shareUnshare(Bookmark bookmark) async {
final result = await BookmarkCommonFunctions.shareUnshare<BookmarksModel>(
scaffoldMessengerKey: ScaffoldMessengerKeys.bookmarks,
ref: ref,
bookmark: bookmark,
apiClient: ref.read(apiClientProvider)!,
);
if (result != null) {
state.bookmarks = state.bookmarks.map((b) => b.id == result.id ? result : b).toList();
ref.notifyListeners();
}
}
}