Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit 4ace778

Browse files
author
Michael Klimushyn
authored
[share] README update (#2297)
Adds a little more info on how to use the plugin. Also adds linter options to prevent any undocumented APIs from being added in the future.
1 parent 3a87296 commit 4ace778

File tree

5 files changed

+30
-3
lines changed

5 files changed

+30
-3
lines changed

packages/share/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.6.3+3
2+
3+
* README update.
4+
15
## 0.6.3+2
26

37
* Remove AndroidX warnings.

packages/share/README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,26 @@ Wraps the ACTION_SEND Intent on Android and UIActivityViewController
99
on iOS.
1010

1111
## Usage
12+
1213
To use this plugin, add `share` as a [dependency in your pubspec.yaml file](https://flutter.io/platform-plugins/).
1314

1415
## Example
1516

16-
Import the library via
17+
Import the library.
18+
1719
``` dart
1820
import 'package:share/share.dart';
1921
```
2022

21-
Then invoke the static `share` method anywhere in your Dart code
23+
Then invoke the static `share` method anywhere in your Dart code.
24+
2225
``` dart
2326
Share.share('check out my website https://example.com');
2427
```
28+
29+
The `share` method also takes an optional `subject` that will be used when
30+
sharing to email.
31+
32+
``` dart
33+
Share.share('check out my website https://example.com', subject: 'Look what I made!');
34+
```

packages/share/analysis_options.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# This exists to add a lint for missing API docs just on this specific package,
2+
# since not all packages have coverage for all their public members yet and
3+
# adding it in would be non-trivial. `public_member_api_docs` should be applied
4+
# to new packages going forward, and ideally the main `analysis_options.yaml`
5+
# file as soon as possible.
6+
7+
include: ../../analysis_options.yaml
8+
9+
linter:
10+
rules:
11+
- public_member_api_docs

packages/share/example/lib/main.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5+
// ignore_for_file: public_member_api_docs
6+
57
import 'package:flutter/material.dart';
68
import 'package:share/share.dart';
79

packages/share/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: Flutter plugin for sharing content via the platform share UI, using
33
the ACTION_SEND intent on Android and UIActivityViewController on iOS.
44
author: Flutter Team <flutter-dev@googlegroups.com>
55
homepage: https://github.com/flutter/plugins/tree/master/packages/share
6-
version: 0.6.3+2
6+
version: 0.6.3+3
77

88
flutter:
99
plugin:

0 commit comments

Comments
 (0)