Handle sharing intents

This commit is contained in:
Juan Gilsanz Polo
2024-03-23 02:10:08 +01:00
parent 9ef870f3e6
commit 601e4fb49b
10 changed files with 114 additions and 9 deletions

View File

@@ -13,10 +13,12 @@ import 'package:linkdy/constants/enums.dart';
class BookmarkFormModal extends ConsumerStatefulWidget {
final Bookmark? bookmark;
final String? url;
const BookmarkFormModal({
super.key,
this.bookmark,
this.url,
});
@override
@@ -29,6 +31,9 @@ class BookmarkFormModalState extends ConsumerState<BookmarkFormModal> {
if (widget.bookmark != null) {
ref.read(bookmarkFormProvider.notifier).initializeProvider(widget.bookmark!);
}
if (widget.url != null) {
ref.read(bookmarkFormProvider.notifier).initializeProviderUrl(widget.url!);
}
super.initState();
}
@@ -421,6 +426,7 @@ class _ModalContent extends ConsumerWidget {
void openBookmarkFormModal({
required BuildContext context,
required double width,
String? url,
Bookmark? bookmark,
}) {
showGeneralDialog(
@@ -434,6 +440,6 @@ void openBookmarkFormModal({
child: child,
);
},
pageBuilder: (context, animation, secondaryAnimation) => BookmarkFormModal(bookmark: bookmark),
pageBuilder: (context, animation, secondaryAnimation) => BookmarkFormModal(bookmark: bookmark, url: url),
);
}