@@ -51,6 +51,8 @@ Access the `SharePlus` instance via `SharePlus.instance`.
5151Then, invoke the ` share() ` method anywhere in your Dart code.
5252
5353``` dart
54+ import 'package:share_plus/share_plus.dart';
55+
5456SharePlus.instance.share(
5557 ShareParams(text: 'check out my website https://example.com')
5658);
@@ -83,6 +85,9 @@ To share one or multiple files, provide the `files` list in `ShareParams`.
8385Optionally, you can pass ` title ` , ` text ` and ` sharePositionOrigin ` .
8486
8587``` dart
88+ import 'package:share_plus/share_plus.dart';
89+ import 'package:cross_file/cross_file.dart';
90+
8691final params = ShareParams(
8792 text: 'Great picture',
8893 files: [XFile('${directory.path}/image.jpg')],
@@ -96,6 +101,9 @@ if (result.status == ShareResultStatus.success) {
96101```
97102
98103``` dart
104+ import 'package:share_plus/share_plus.dart';
105+ import 'package:cross_file/cross_file.dart';
106+
99107final params = ShareParams(
100108 files: [
101109 XFile('${directory.path}/image1.jpg'),
@@ -119,6 +127,8 @@ package.
119127File downloading fallback mechanism for web can be disabled by setting:
120128
121129``` dart
130+ import 'package:share_plus/share_plus.dart';
131+
122132ShareParams(
123133 // rest of params
124134 downloadFallbackEnabled: false,
@@ -132,6 +142,10 @@ You can also share files that you dynamically generate from its data using [`XFi
132142To set the name of such files, use the ` fileNameOverrides ` parameter, otherwise the file name will be a random UUID string.
133143
134144``` dart
145+ import 'package:share_plus/share_plus.dart';
146+ import 'package:cross_file/cross_file.dart';
147+ import 'dart:convert';
148+
135149final params = ShareParams(
136150 files: [XFile.fromData(utf8.encode(text), mimeType: 'text/plain')],
137151 fileNameOverrides: ['myfile.txt']
@@ -150,6 +164,8 @@ This special functionality is only properly supported on iOS.
150164On other platforms, the URI will be shared as plain text.
151165
152166``` dart
167+ import 'package:share_plus/share_plus.dart';
168+
153169final params = ShareParams(uri: uri);
154170
155171SharePlus.instance.share(params);
@@ -233,7 +249,7 @@ or search for other Flutter plugins implementing this SDK. More information can
233249Other apps may also give problems when attempting to share content to them.
234250This is because 3rd party app developers do not properly implement the logic to receive share actions.
235251
236- We cannot warranty that a 3rd party app will properly implement the share functionality.
252+ We cannot guarantee that a 3rd party app will properly implement the share functionality.
237253Therefore, ** all bugs reported regarding compatibility with a specific app will be closed.**
238254
239255#### Localization in Apple platforms
@@ -249,7 +265,7 @@ For more information check the [CoreFoundationKeys](https://developer.apple.com/
249265` share_plus ` requires iPad users to provide the ` sharePositionOrigin ` parameter.
250266
251267Without it, ` share_plus ` will not work on iPads and may cause a crash or
252- letting the UI not responding .
268+ leave the UI unresponsive .
253269
254270To avoid that problem, provide the ` sharePositionOrigin ` .
255271
@@ -292,6 +308,8 @@ To convert code using `Share.share()` to the new `SharePlus` class:
292308e.g.
293309
294310``` dart
311+ import 'package:share/share.dart';
312+
295313Share.share("Shared text");
296314
297315Share.shareUri("http://example.com");
@@ -302,6 +320,8 @@ Share.shareXFiles(files);
302320Becomes:
303321
304322``` dart
323+ import 'package:share_plus/share_plus.dart';
324+
305325SharePlus.instance.share(
306326 ShareParams(text: "Shared text"),
307327);
0 commit comments