migrate share deprecations
This commit is contained in:
+9
-4
@@ -190,7 +190,9 @@ class WebPageDialog extends HookConsumerWidget {
|
||||
leading: const Icon(Icons.share),
|
||||
title: const Text('Share link'),
|
||||
onTap: () async {
|
||||
await Share.shareUri(url);
|
||||
await SharePlus.instance.share(
|
||||
ShareParams(uri: url),
|
||||
);
|
||||
|
||||
if (context.mounted) {
|
||||
context.pop();
|
||||
@@ -220,9 +222,12 @@ class WebPageDialog extends HookConsumerWidget {
|
||||
mimeType: 'image/png',
|
||||
);
|
||||
|
||||
await Share.shareXFiles([
|
||||
file,
|
||||
], subject: precachedInfo?.title);
|
||||
await SharePlus.instance.share(
|
||||
ShareParams(
|
||||
files: [file],
|
||||
subject: precachedInfo?.title,
|
||||
),
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
+2
-2
@@ -126,7 +126,7 @@ class BrowserBottomAppBar extends HookConsumerWidget {
|
||||
},
|
||||
leadingIcon: const Icon(MdiIcons.tabUnselected),
|
||||
child: const Text('Add Private Tab'),
|
||||
),
|
||||
),
|
||||
MenuItemButton(
|
||||
onPressed: () async {
|
||||
await const SearchRoute(
|
||||
@@ -300,7 +300,7 @@ class BrowserBottomAppBar extends HookConsumerWidget {
|
||||
final tabState = ref.read(tabStateProvider(selectedTabId));
|
||||
|
||||
if (tabState?.url case final Uri url) {
|
||||
await Share.shareUri(url);
|
||||
await SharePlus.instance.share(ShareParams(uri: url));
|
||||
}
|
||||
},
|
||||
leadingIcon: const Icon(Icons.share),
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ class ShareEmail extends HookConsumerWidget {
|
||||
onTap: () async {
|
||||
final email = hitResult.tryGetLink().mapNotNull((url) => url.path);
|
||||
if (email != null) {
|
||||
await Share.share(email);
|
||||
await SharePlus.instance.share(ShareParams(text: email));
|
||||
|
||||
if (context.mounted) {
|
||||
context.pop();
|
||||
|
||||
+3
-1
@@ -21,7 +21,9 @@ class ShareLink extends HookConsumerWidget {
|
||||
leading: const Icon(Icons.share),
|
||||
title: const Text('Share link'),
|
||||
onTap: () async {
|
||||
await hitResult.tryGetLink().mapNotNull((url) => Share.shareUri(url));
|
||||
await hitResult.tryGetLink().mapNotNull(
|
||||
(url) => SharePlus.instance.share(ShareParams(uri: url)),
|
||||
);
|
||||
|
||||
if (context.mounted) {
|
||||
context.pop();
|
||||
|
||||
Reference in New Issue
Block a user