Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/android_alarm_manager_plus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ This intent has the action `android.intent.action.MAIN` and includes the followi
Setting the alarm:

```dart
import 'package:android_alarm_manager_plus/android_alarm_manager_plus.dart';

await AndroidAlarmManager.oneShotAt(
time,
id,
Expand Down
2 changes: 2 additions & 0 deletions packages/android_intent_plus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ of integers or strings.
or get the details of the activity that can handle the intent.

```dart
import 'package:android_intent_plus/android_intent.dart';

final intent = AndroidIntent(
action: 'action_view',
data: Uri.encodeFull('http://'),
Expand Down
34 changes: 22 additions & 12 deletions packages/connectivity_plus/connectivity_plus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,31 @@ This method should ensure emitting only distinct values.

```dart
import 'package:connectivity_plus/connectivity_plus.dart';
import 'dart:async';

@override
initState() {
super.initState();

StreamSubscription<List<ConnectivityResult>> subscription = Connectivity().onConnectivityChanged.listen((List<ConnectivityResult> result) {
// Received changes in available connectivity types!
});
class MyWidget extends StatefulWidget {
@override
_MyWidgetState createState() => _MyWidgetState();
}

// Be sure to cancel subscription after you are done
@override
dispose() {
subscription.cancel();
super.dispose();
class _MyWidgetState extends State<MyWidget> {
StreamSubscription<List<ConnectivityResult>>? subscription;

@override
void initState() {
super.initState();

subscription = Connectivity().onConnectivityChanged.listen((List<ConnectivityResult> result) {
// Received changes in available connectivity types!
});
}

// Be sure to cancel subscription after you are done
@override
void dispose() {
subscription?.cancel();
super.dispose();
}
}
```

Expand Down
2 changes: 2 additions & 0 deletions packages/sensors_plus/sensors_plus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ Alternatively, every stream allows to specify the sampling rate for its sensor u


```dart
import 'package:sensors_plus/sensors_plus.dart';

magnetometerEvents(samplingPeriod: SensorInterval.normalInterval).listen(
(MagnetometerEvent event) {
print(event);
Expand Down
24 changes: 22 additions & 2 deletions packages/share_plus/share_plus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ Access the `SharePlus` instance via `SharePlus.instance`.
Then, invoke the `share()` method anywhere in your Dart code.

```dart
import 'package:share_plus/share_plus.dart';

SharePlus.instance.share(
ShareParams(text: 'check out my website https://example.com')
);
Expand Down Expand Up @@ -83,6 +85,9 @@ To share one or multiple files, provide the `files` list in `ShareParams`.
Optionally, you can pass `title`, `text` and `sharePositionOrigin`.

```dart
import 'package:share_plus/share_plus.dart';
import 'package:cross_file/cross_file.dart';

final params = ShareParams(
text: 'Great picture',
files: [XFile('${directory.path}/image.jpg')],
Expand All @@ -96,6 +101,9 @@ if (result.status == ShareResultStatus.success) {
```

```dart
import 'package:share_plus/share_plus.dart';
import 'package:cross_file/cross_file.dart';

final params = ShareParams(
files: [
XFile('${directory.path}/image1.jpg'),
Expand All @@ -119,6 +127,8 @@ package.
File downloading fallback mechanism for web can be disabled by setting:

```dart
import 'package:share_plus/share_plus.dart';

ShareParams(
// rest of params
downloadFallbackEnabled: false,
Expand All @@ -132,6 +142,10 @@ You can also share files that you dynamically generate from its data using [`XFi
To set the name of such files, use the `fileNameOverrides` parameter, otherwise the file name will be a random UUID string.

```dart
import 'package:share_plus/share_plus.dart';
import 'package:cross_file/cross_file.dart';
import 'dart:convert';

final params = ShareParams(
files: [XFile.fromData(utf8.encode(text), mimeType: 'text/plain')],
fileNameOverrides: ['myfile.txt']
Expand All @@ -150,6 +164,8 @@ This special functionality is only properly supported on iOS.
On other platforms, the URI will be shared as plain text.

```dart
import 'package:share_plus/share_plus.dart';

final params = ShareParams(uri: uri);

SharePlus.instance.share(params);
Expand Down Expand Up @@ -233,7 +249,7 @@ or search for other Flutter plugins implementing this SDK. More information can
Other apps may also give problems when attempting to share content to them.
This is because 3rd party app developers do not properly implement the logic to receive share actions.

We cannot warranty that a 3rd party app will properly implement the share functionality.
We cannot warrant that a 3rd party app will properly implement the share functionality.
Comment thread
vbuberen marked this conversation as resolved.
Outdated
Therefore, **all bugs reported regarding compatibility with a specific app will be closed.**

#### Localization in Apple platforms
Expand All @@ -249,7 +265,7 @@ For more information check the [CoreFoundationKeys](https://developer.apple.com/
`share_plus` requires iPad users to provide the `sharePositionOrigin` parameter.

Without it, `share_plus` will not work on iPads and may cause a crash or
letting the UI not responding.
leave the UI unresponsive.

To avoid that problem, provide the `sharePositionOrigin`.

Expand Down Expand Up @@ -292,6 +308,8 @@ To convert code using `Share.share()` to the new `SharePlus` class:
e.g.

```dart
import 'package:share/share.dart';

Share.share("Shared text");

Share.shareUri("http://example.com");
Expand All @@ -302,6 +320,8 @@ Share.shareXFiles(files);
Becomes:

```dart
import 'package:share_plus/share_plus.dart';

SharePlus.instance.share(
ShareParams(text: "Shared text"),
);
Expand Down