From b1c6977232b015fa4944ff9a769f7a0304f303e8 Mon Sep 17 00:00:00 2001 From: Majid Hajian Date: Mon, 12 Oct 2020 18:43:47 +0200 Subject: [PATCH] add readme, workflows, author and more structure to plus plugins (#8) * add readme, workflows, author and more structure to plus plugins * Add exec permissions to workflow scripts * add packages description * update melos --- .editorconfig | 10 + .github/PULL_REQUEST_TEMPLATE.md | 33 +++ .github/workflows/all_plugins.yaml | 100 +++++++ .github/workflows/scripts/install-flutter.sh | 13 + .github/workflows/scripts/install-tools.sh | 6 + .../workflows/scripts/validate-formatting.sh | 30 ++ .gitignore | 1 - .vscode/settings.json | 3 + .vscode/tasks.json | 49 ++++ AUTHORS | 4 + CONTRIBUTING.md | 209 ++++++++++++++ LICENSE | 27 ++ README.md | 260 +++++++++++++++++- analysis_options.yaml | 4 + docs/README.md | 3 + melos.yaml | 61 +++- website/README.md | 5 + 17 files changed, 813 insertions(+), 5 deletions(-) create mode 100644 .editorconfig create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/workflows/all_plugins.yaml create mode 100755 .github/workflows/scripts/install-flutter.sh create mode 100755 .github/workflows/scripts/install-tools.sh create mode 100755 .github/workflows/scripts/validate-formatting.sh create mode 100644 .vscode/settings.json create mode 100644 .vscode/tasks.json create mode 100644 AUTHORS create mode 100644 CONTRIBUTING.md create mode 100644 LICENSE create mode 100644 analysis_options.yaml create mode 100644 docs/README.md create mode 100644 website/README.md diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000..7451d9ae75 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,10 @@ +# editorconfig +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000..ec6d216fd5 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,33 @@ +## Description + +*Replace this paragraph with a description of what this PR is doing. If you're modifying existing behavior, describe the existing behavior, how this PR is changing it, and what motivated the change.* + +## Related Issues + +*Replace this paragraph with a list of issues related to this PR from the [issue database](https://github.com/flutter/flutter/issues). Indicate, which of these issues are resolved or fixed by this PR. Note that you'll have to prefix the issue numbers with flutter/flutter#.* + +## Checklist + +Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (`[x]`). +This will ensure a smooth and quick review process. Updating the `pubspec.yaml` and changelogs is not required. + +- [ ] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. +- [ ] My PR includes unit or integration tests for *all* changed/updated/fixed behaviors (See [Contributor Guide]). +- [ ] All existing and new tests are passing. +- [ ] I updated/added relevant documentation (doc comments with `///`). +- [ ] The analyzer (`flutter analyze`) does not report any problems on my PR. +- [ ] I read and followed the [Flutter Style Guide]. +- [ ] I am willing to follow-up on review comments in a timely manner. + +## Breaking Change + +Does your PR require plugin users to manually update their apps to accommodate your change? + +- [ ] Yes, this is a breaking change (please indicate a breaking change in CHANGELOG.md and increment major revision). +- [ ] No, this is *not* a breaking change. + + +[issue database]: https://github.com/flutter/flutter/issues +[Contributor Guide]: https://github.com/fluttercommunity/plus_plugins/blob/master/CONTRIBUTING.md +[Flutter Style Guide]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo +[pub versioning philosophy]: https://dart.dev/tools/pub/versioning diff --git a/.github/workflows/all_plugins.yaml b/.github/workflows/all_plugins.yaml new file mode 100644 index 0000000000..d5b7fa5721 --- /dev/null +++ b/.github/workflows/all_plugins.yaml @@ -0,0 +1,100 @@ +name: all_plugins + +on: + pull_request: + push: + branches: + - main + paths-ignore: + - 'docs/**' + +jobs: + analyze: + timeout-minutes: 15 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + with: + fetch-depth: 0 + - name: 'Install Flutter' + run: ./.github/workflows/scripts/install-flutter.sh stable + - name: 'Install Tools' + run: | + ./.github/workflows/scripts/install-tools.sh + flutter pub global activate tuneup + - name: 'Bootstrap Workspace' + run: melos bootstrap + - name: 'Dart Analyze' + run: | + melos exec -c 3 -- \ + tuneup check + - name: 'Pub Check' + run: | + melos exec -c 1 --no-private --ignore="*example*" -- \ + pub publish --dry-run + format: + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - uses: actions/checkout@v1 + with: + fetch-depth: 0 + - name: 'Install Flutter' + run: ./.github/workflows/scripts/install-flutter.sh stable + - name: 'Install Tools' + run: | + ./.github/workflows/scripts/install-tools.sh + curl -sL https://github.com/google/google-java-format/releases/download/google-java-format-1.3/google-java-format-1.3-all-deps.jar -o $HOME/google-java-format.jar + - name: 'Bootstrap Workspace' + run: melos bootstrap + - name: 'Dart' + run: | + melos exec -c 1 -- \ + flutter format . + ./.github/workflows/scripts/validate-formatting.sh + - name: 'Objective-C' + if: ${{ success() || failure() }} + run: | + melos exec -c 4 --ignore="*platform_interface*" --ignore="*web*" -- \ + find . -maxdepth 3 -name "*.h" -o -name "*.m" -print0 \| xargs -0 clang-format -i --style=Google --verbose + ./.github/workflows/scripts/validate-formatting.sh + - name: 'Java' + if: ${{ success() || failure() }} + run: | + melos exec -c 4 --ignore="*platform_interface*" --ignore="*web*" -- \ + find . -maxdepth 12 -name "*.java" -print0 \| xargs -0 java -jar $HOME/google-java-format.jar --replace + ./.github/workflows/scripts/validate-formatting.sh + build_examples_dart: + timeout-minutes: 15 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + with: + fetch-depth: 0 + - name: 'Install Flutter' + run: ./.github/workflows/scripts/install-flutter.sh stable + - name: 'Install Tools' + run: ./.github/workflows/scripts/install-tools.sh + - name: 'Bootstrap Workspace' + run: melos bootstrap + - name: 'Build Example Snapshots' + run: | + melos exec -c 1 --scope="*example*" -- \ + flutter build aot + test: + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - uses: actions/checkout@v1 + with: + fetch-depth: 0 + - name: 'Install Flutter' + run: ./.github/workflows/scripts/install-flutter.sh stable + - name: 'Install Tools' + run: ./.github/workflows/scripts/install-tools.sh + - name: 'Bootstrap Workspace' + run: melos bootstrap + - name: 'Flutter Test' + run: | + melos exec -c 3 --dir-exists=test --ignore="*example*" --ignore="*web*" -- \ + flutter test diff --git a/.github/workflows/scripts/install-flutter.sh b/.github/workflows/scripts/install-flutter.sh new file mode 100755 index 0000000000..f50bc20b42 --- /dev/null +++ b/.github/workflows/scripts/install-flutter.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +BRANCH=$1 + +if [ "$BRANCH" == "dev" ] +then + # TODO Flutter dev branch is currently broken so we're unable to test MacOS. + echo "TODO: Skipping macOS testing due to Flutter dev branch issue. Switching branch to stable." + BRANCH=stable +fi + +git clone https://github.com/flutter/flutter.git --depth 1 -b $BRANCH _flutter +echo "::add-path::$GITHUB_WORKSPACE/_flutter/bin" \ No newline at end of file diff --git a/.github/workflows/scripts/install-tools.sh b/.github/workflows/scripts/install-tools.sh new file mode 100755 index 0000000000..087cfecb52 --- /dev/null +++ b/.github/workflows/scripts/install-tools.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +flutter pub global activate melos +echo "::add-path::$HOME/.pub-cache/bin" +echo "::add-path::$GITHUB_WORKSPACE/_flutter/.pub-cache/bin" +echo "::add-path::$GITHUB_WORKSPACE/_flutter/bin/cache/dart-sdk/bin" \ No newline at end of file diff --git a/.github/workflows/scripts/validate-formatting.sh b/.github/workflows/scripts/validate-formatting.sh new file mode 100755 index 0000000000..27e33215f8 --- /dev/null +++ b/.github/workflows/scripts/validate-formatting.sh @@ -0,0 +1,30 @@ +#!/bin/bash +if [[ $(git ls-files --modified) ]]; then + echo "" + echo "" + echo "These files are not formatted correctly:" + for f in $(git ls-files --modified); do + echo "" + echo "" + echo "-----------------------------------------------------------------" + echo "$f" + echo "-----------------------------------------------------------------" + echo "" + git --no-pager diff --unified=0 --minimal $f + echo "" + echo "-----------------------------------------------------------------" + echo "" + echo "" + done + if [[ $GITHUB_WORKFLOW ]]; then + git checkout . > /dev/null 2>&1 + fi + echo "" + echo "❌ Some files are incorrectly formatted, see above output." + echo "" + echo "To fix these locally, run: 'melos run format'." + exit 1 +else + echo "" + echo "✅ All files are formatted correctly." +fi \ No newline at end of file diff --git a/.gitignore b/.gitignore index 88ce490e47..6f029bb0d3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,6 @@ .DS_Store .atom/ .idea/ -.vscode/ .packages .pub/ diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000000..aadcdc244f --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "dart.runPubGetOnPubspecChanges": false +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000000..188d83ff4f --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,49 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "melos:bootstrap", + "type": "shell", + "command": "melos bootstrap", + "detail": "Bootstrap this current workspace and link all packages together", + "problemMatcher": [] + }, + { + "label": "melos:clean", + "type": "shell", + "command": "melos clean", + "detail": "Clean the current workspace and all build & temporary pub files", + "problemMatcher": [] + }, + { + "label": "melos:run", + "type": "shell", + "command": "melos run", + "presentation": { + "echo": true, + "reveal": "always", + "focus": true, + "panel": "shared", + "showReuseMessage": false, + "clear": true + }, + "detail": "Select a script defined in melos.yaml to run", + "problemMatcher": [] + }, + { + "label": "format", + "type": "shell", + "command": "melos run format", + "detail": "Format all .dart, .h, .m & .java files in the project", + "problemMatcher": [] + }, + { + "label": "chromedriver", + "isBackground": true, + "type": "shell", + "command": "chromedriver --port=4444", + "detail": "Start a background chromedriver instance port on 4444", + "problemMatcher": [] + } + ] +} diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000000..cf627cfdd6 --- /dev/null +++ b/AUTHORS @@ -0,0 +1,4 @@ +Majid Hajian +Simon Lightfoot +J-P Nurmi +Miguel Beltran \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000000..5ea960b74a --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,209 @@ +# Contributing to PlusPlugins + +_See also: [Flutter's code of conduct](https://flutter.io/design-principles/#code-of-conduct)_ + +## 1. Things you will need + +- Linux, Mac OS X, or Windows. +- [git](https://git-scm.com) (used for source version control). +- An ssh client (used to authenticate with GitHub). +- An IDE such as [Android Studio](https://developer.android.com/studio) or [Visual Studio Code](https://code.visualstudio.com/). +- [`flutter_plugin_tools`](https://pub.dev/packages/flutter_plugin_tools) locally activated. +- [`tuneup`](https://pub.dev/packages/tuneup) locally activated. + +## 2. Forking & cloning the repository + +- Ensure all the dependencies described in the previous section are installed. +- Fork `https://github.com/fluttercommunity/plus_plugins` into your own GitHub account. If + you already have a fork, and are now installing a development environment on + a new machine, make sure you've updated your fork so that you don't use stale + configuration options from long ago. +- If you haven't configured your machine with an SSH key that's known to github, then + follow [GitHub's directions](https://help.github.com/articles/generating-ssh-keys/) + to generate an SSH key. +- `git clone git@github.com:/plus_plugins.git` +- `git remote add upstream git@github.com:fluttercommunity/plus_plugins.git` (So that you + fetch from the master repository, not your clone, when running `git fetch` + et al.) + +## 3. Environment Setup + +PlusPlugins uses [Melos](https://github.com/invertase/melos) to manage the project and dependencies. + +To install Melos, run the following command from your SSH client: + +```bash +pub global activate melos +``` + +Next, at the root of your locally cloned repository bootstrap the projects dependencies: + +```bash +melos bootstrap +``` + +The bootstrap command locally links all dependencies within the project without having to +provide manual [`dependency_overrides`](https://dart.dev/tools/pub/pubspec). This allows all +plugins, examples and tests to build from the local clone project. + +> You do not need to run `flutter pub get` once bootstrap has been completed. + +## 4. Running an example + +Each plugin provides an example app which aims to showcase the main use-cases of each plugin. + +To run an example, run the `flutter run` command from the `example` directory of each plugins main +directory. For example, for `sensors_plus` example: + +```bash +cd packages/sensors_plus/sensors_plus/example +flutter run +``` + +Using Melos (installed in step 3), any changes made to the plugins locally will also be reflected within all +example applications code automatically. + +## 4. Running tests + +PlusPlugins comprises of a number of tests for each plugin, either end-to-end (e2e) or unit tests. + +### Unit tests + +Unit tests are responsible for ensuring expected behavior whilst developing the plugins Dart code. Unit tests do not +interact with 3rd party services, and mock where possible. To run unit tests for a specific plugin, run the +`flutter test` command from the plugins root directory. For example, sensors_plus platform interface tests can be run +with the following commands: + +```bash +cd packages/sensors_plus/sensors_plus_platform_interface +flutter test +``` + +### End-to-end (e2e) tests + +E2e tests are those which directly communicate with Flutter, whose results cannot be mocked. These tests run directly from +an example application. To run e2e tests, run the `flutter drive` command from the plugins main `example` directory, targeting the +entry e2e test file. + +```bash +cd packages/sensors_plus/sensors_plus/example +flutter drive --target=./test_driver/sensors_plus_e2e.dart +``` + +To run tests against web environments, run the command as a release build: + +```bash +cd packages/sensors_plus/sensors_plus/example +flutter drive --target=./test_driver/sensors_plus_e2e.dart --release -d chrome +``` + +### Using Melos + +To help aid developer workflow, Melos provides a number of commands to quickly run +tests against plugins. For example, to run all e2e tests across all plugins at once, +run the following command from the root of your cloned repository: + +```bash +melos run test:e2e +``` + +A full list of all commands can be found within the [`melos.yaml`](https://github.com/fluttercommunity/plus_plugins/blob/master/melos.yaml) +file. + +## 5. Contributing code + +We gladly accept contributions via GitHub pull requests. + +Please peruse the +[Flutter style guide](https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo) and +[design principles](https://flutter.io/design-principles/) before +working on anything non-trivial. These guidelines are intended to +keep the code consistent and avoid common pitfalls. + +To start working on a patch: + +1. `git fetch upstream` +2. `git checkout upstream/master -b ` +3. Hack away! + +Once you have made your changes, ensure that it passes the internal analyzer & formatting checks. The following +commands can be run locally to highlight any issues before committing your code: + +```bash +# Run the analyze check +melos run analyze + +# Format code +melos run format +``` + +Assuming all is successful, commit and push your code: + +1. `git commit -a -m ""` +2. `git push origin ` + +To send us a pull request: + +- `git pull-request` (if you are using [Hub](http://github.com/github/hub/)) or + go to `https://github.com/fluttercommunity/plus_plugins` and click the + "Compare & pull request" button + +Please make sure all your check-ins have detailed commit messages explaining the patch. + +When naming the title of your pull request, please follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0-beta.4/) +guide. For example, for a fix to the `sensor_plus` plugin: + +`fix(sensor_plus): fixed a bug!` + +Plugins tests are run automatically on contributions using GitHub Actions. Depending on +your code contributions, various tests will be run against your updated code automatically. + +Once you've gotten an LGTM from a project maintainer and once your PR has received +the green light from all our automated testing, wait for one the package maintainers +to merge the pull request. + +If you've never submitted code before, you must add your (or your +organization's) name and contact info to the [AUTHORS](AUTHORS) file. + +### The review process + +Newly opened PRs first go through initial triage which results in one of: + +- **Merging the PR** - if the PR can be quickly reviewed and looks good. +- **Closing the PR** - if the PR maintainer decides that the PR should not be merged. +- **Moving the PR to the backlog** - if the review requires non trivial effort and the issue isn't a priority; in this case the maintainer will: + - Make sure that the PR has an associated issue labeled with "plugin". + - Add the "backlog" label to the issue. + - Leave a comment on the PR explaining that the review is not trivial and that the issue will be looked at according to priority order. +- **Starting a non trivial review** - if the review requires non trivial effort and the issue is a priority; in this case the maintainer will: + - Add the "in review" label to the issue. + - Self assign the PR. + +### The release process + +We push releases manually, using [Melos](https://github.com/invertase/melos) +to take care of the hard work. + +Changelogs and version updates are automatically updated by a project maintainer +(via [Melos](https://github.com/invertase/melos)). The new version is automatically +generated via the commit types and changelogs via the commit messages. + +Some things to keep in mind before publishing the release: + +- Has CI ran on the master commit and gone green? Even if CI shows as green on + the PR it's still possible for it to fail on merge, for multiple reasons. + There may have been some bug in the merge that introduced new failures. CI + runs on PRs as it's configured on their branch state, and not on tip of tree. + CI on PRs also only runs tests for packages that it detects have been directly + changed, vs running on every single package on master. +- [Publishing is + forever.](https://dart.dev/tools/pub/publishing#publishing-is-forever) + Hopefully any bugs or breaking in changes in this PR have already been caught + in PR review, but now's a second chance to revert before anything goes live. +- "Don't deploy on a Friday." Consider carefully whether or not it's worth + immediately publishing an update before a stretch of time where you're going + to be unavailable. There may be bugs with the release or questions about it + from people that immediately adopt it, and uncovering and resolving those + support issues will take more time if you're unavailable. + +TODO(mhadaily): detail melos release process diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000..18c6ba2786 --- /dev/null +++ b/LICENSE @@ -0,0 +1,27 @@ +Copyright 2017 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/README.md b/README.md index b589ab4dd0..c363ea21f5 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,259 @@ -Flutter Community Plus Packages -=============================== +

+ + Flutter Community Plus Plugins
+
+

Plus plugins

+

+

+ + all_plugins GitHub Workflow Status + + + Follow on Twitter + +

+ +--- + +PlusPlugins is a set of [Flutter plugins](https://flutter.io/platform-plugins/) that is developed based on existing [Flutter plugins](https://github.com/flutter/plugins) with extra functionalities, platforms support, and better maintenance. + +[Flutter](https://flutter.dev) is Google’s UI toolkit for building beautiful, natively compiled applications for mobile, web, and desktop from a single codebase. Flutter is used by developers and organizations around the world, and is free and open source. + +> *Note*: PlusPlugins is still under development (see [roadmap](https://github.com/fluttercommunity/plus_plugins/issues/2582)), + +[Feedback](https://github.com/fluttercommunity/plus_plugins/issues) and [Pull Requests](https://github.com/fluttercommunity/plus_plugins/pulls) are most welcome! + +## Plugins + +**Table of contents:** + + - [Battery➕ (`battery_plus`)](#battery_plus) + - [Connectivity➕ (`connectivity_plus`)](#connectivity_plus) + - [NetworkInfo➕ (`network_plus`)](#network_plus) + - [Device Info➕ (`device_info_plus`)](#device_info_plus) + - [Package Info➕ (`package_info_plus`)](#package_info_plus) + - [Sensor➕ (`sensor_plus`)](#sensor_plus) + - [Share➕ (`share_plus`)](#share_plus) + - [Android Alarm Manager➕ (`android_alarm_manager_plus`)](#android_alarm_manager_plus) + - [Android Intent➕ (`android_intent_plus`)](#android_intent_plus) +--- + +### `battery_plus` + +> ![battery_plus][battery_plus_badge_pub] [![pub points][battery_plus_badge_pub_points]][battery_plus_pub_points] + +Flutter plugin for accessing information about the battery state(full, charging, discharging) on Android and iOS. + +[[View Source][battery_plus_code]] + +#### Platform Support + +| Android | iOS | MacOS | Web | Linux | Window | +|:-------:|:---:|:-----:|:---:|:-----:|:------:| +| ✔️ | ✔️ | | ✔️ | ✔️ | | + +---- + +### `connectivity_plus` + +> ![connectivity_plus][connectivity_plus_badge_pub] [![pub points][connectivity_plus_badge_pub_points]][connectivity_plus_pub_points] + +Flutter plugin for discovering the state of the network (WiFi & +mobile/cellular) connectivity on Android and iOS. + +[[View Source][connectivity_plus_code]] + +#### Platform Support + +| Android | iOS | MacOS | Web | Linux | Window | +|:-------:|:---:|:-----:|:---:|:-----:|:------:| +| ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | + +---- + +### `network_plus` + +> ![network_plus][network_plus_badge_pub] [![pub points][network_plus_badge_pub_points]][network_plus_pub_points] + +TBD + +[[View Source][network_plus_code]] + +#### Platform Support + +| Android | iOS | MacOS | Web | Linux | Window | +|:-------:|:---:|:-----:|:---:|:-----:|:------:| +| | | | | | | + +---- + +### `device_info_plus` + +> ![device_info_plus][device_info_plus_badge_pub] [![pub points][device_info_plus_badge_pub_points]][device_info_plus_pub_points] + +Flutter plugin providing detailed information about the device + (make, model, etc.), and Android or iOS version the app is running on. + +[[View Source][device_info_plus_code]] + +#### Platform Support + +| Android | iOS | MacOS | Web | Linux | Window | +|:-------:|:---:|:-----:|:---:|:-----:|:------:| +| ✔️ | ✔️ | | ✔️ | ✔️ | | + +---- + +### `package_info_plus` + +> ![package_info_plus][package_info_plus_badge_pub] [![pub points][package_info_plus_badge_pub_points]][package_info_plus_pub_points] + +Flutter plugin for querying information about the application + package, such as CFBundleVersion on iOS or versionCode on Android. + +[[View Source][package_info_plus_code]] + +#### Platform Support + +| Android | iOS | MacOS | Web | Linux | Window | +|:-------:|:---:|:-----:|:---:|:-----:|:------:| +| ✔️ | ✔️ | ✔️ | ✔️ | | | + +---- + +### `sensor_plus` + +> ![sensor_plus][sensor_plus_badge_pub] [![pub points][sensor_plus_badge_pub_points]][sensor_plus_pub_points] + +Flutter plugin for accessing accelerometer and gyroscope sensors. + +[[View Source][sensor_plus_code]] + +#### Platform Support + +| Android | iOS | MacOS | Web | Linux | Window | +|:-------:|:---:|:-----:|:---:|:-----:|:------:| +| ✔️ | ✔️ | | ✔️ | | | + +---- + +### `share_plus` + +> ![share_plus][share_plus_badge_pub] [![pub points][share_plus_badge_pub_points]][share_plus_pub_points] + +Flutter plugin for sharing content via the platform share UI, using the ACTION_SEND intent on Android and UIActivityViewController on iOS. + +[[View Source][share_plus_code]] + +#### Platform Support + +| Android | iOS | MacOS | Web | Linux | Window | +|:-------:|:---:|:-----:|:---:|:-----:|:------:| +| ✔️ | ✔️ | | | ✔️ | ✔️ | + +---- + +### `android_alarm_manager_plus` + +> ![android_alarm_manager_plus][android_alarm_manager_plus_badge_pub] [![pub points][android_alarm_manager_plus_badge_pub_points]][android_alarm_manager_plus_pub_points] + +Flutter plugin for accessing the Android AlarmManager service, and running Dart code in the background when alarms fire. + +[[View Source][android_alarm_manager_plus_code]] + +#### Platform Support + +| Android | +|:-------:| +| ✔️ | + +---- + +### `android_intent_plus` + +> ![android_intent_plus][android_intent_plus_badge_pub] [![pub points][android_intent_plus_badge_pub_points]][android_intent_plus_pub_points] + +Flutter plugin for launching Android Intents. Not supported on iOS. + +[[View Source][android_intent_plus_code]] + +#### Platform Support + +| Android | +|:-------:| +| ✔️ | + +---- + +## Issues + +Please file PlusPlugins specific issues, bugs, or feature requests in our [issue tracker](https://github.com/fluttercommunity/plus_plugins/issues/new). + +Plugin issues that are not specific to PlusPlugins can be filed in the [Flutter issue tracker](https://github.com/flutter/flutter/issues/new). + +## Contributing + +If you wish to contribute a change to any of the existing plugins in this repo, +please review our [contribution guide](https://github.com/fluttercommunity/plus_plugins/blob/master/CONTRIBUTING.md) +and open a [pull request](https://github.com/fluttercommunity/plus_plugins/pulls). + +## Status + +![Status: Experimental](https://img.shields.io/badge/Status-Experimental-blue) + +This repository is maintained by FlutterCommunity authors. Issues here are answered by maintainers and other community members on GitHub on a best-effort basis. + +[battery_plus]: https://pub.dev/packages/battery_plus +[battery_plus_code]: https://github.com/fluttercommunity/plus_plugins/tree/master/packages/battery_plus +[battery_plus_pub_points]: https://pub.dev/packages/battery_plus/score +[battery_plus_badge_pub_points]: https://badges.bar/battery_plus/pub%20points +[battery_plus_badge_pub]: https://img.shields.io/pub/v/battery_plus.svg + +[connectivity_plus]: https://pub.dev/packages/connectivity_plus +[connectivity_plus_code]: https://github.com/fluttercommunity/plus_plugins/tree/master/packages/connectivity_plus +[connectivity_plus_pub_points]: https://pub.dev/packages/connectivity_plus/score +[connectivity_plus_badge_pub_points]: https://badges.bar/connectivity_plus/pub%20points +[connectivity_plus_badge_pub]: https://img.shields.io/pub/v/connectivity_plus.svg + +[network_plus]: https://pub.dev/packages/network_plus +[network_plus_code]: https://github.com/fluttercommunity/plus_plugins/tree/master/packages/network_plus +[network_plus_pub_points]: https://pub.dev/packages/network_plus/score +[network_plus_badge_pub_points]: https://badges.bar/network_plus/pub%20points +[network_plus_badge_pub]: https://img.shields.io/pub/v/network_plus.svg + +[android_alarm_manager_plus]: https://pub.dev/packages/android_alarm_manager_plus +[android_alarm_manager_plus_code]: https://github.com/fluttercommunity/plus_plugins/tree/master/packages/android_alarm_manager_plus +[android_alarm_manager_plus_pub_points]: https://pub.dev/packages/android_alarm_manager_plus/score +[android_alarm_manager_plus_badge_pub_points]: https://badges.bar/android_alarm_manager_plus/pub%20points +[android_alarm_manager_plus_badge_pub]: https://img.shields.io/pub/v/android_alarm_manager_plus.svg + +[android_intent_plus]: https://pub.dev/packages/android_intent_plus +[android_intent_plus_code]: https://github.com/fluttercommunity/plus_plugins/tree/master/packages/android_intent_plus +[android_intent_plus_pub_points]: https://pub.dev/packages/android_intent_plus/score +[android_intent_plus_badge_pub_points]: https://badges.bar/android_intent_plus/pub%20points +[android_intent_plus_badge_pub]: https://img.shields.io/pub/v/android_intent_plus.svg + +[device_info_plus]: https://pub.dev/packages/device_info_plus +[device_info_plus_code]: https://github.com/fluttercommunity/plus_plugins/tree/master/packages/device_info_plus +[device_info_plus_pub_points]: https://pub.dev/packages/device_info_plus/score +[device_info_plus_badge_pub_points]: https://badges.bar/device_info_plus/pub%20points +[device_info_plus_badge_pub]: https://img.shields.io/pub/v/device_info_plus.svg + +[package_info_plus]: https://pub.dev/packages/package_info_plus +[package_info_plus_code]: https://github.com/fluttercommunity/plus_plugins/tree/master/packages/package_info_plus +[package_info_plus_pub_points]: https://pub.dev/packages/package_info_plus/score +[package_info_plus_badge_pub_points]: https://badges.bar/package_info_plus/pub%20points +[package_info_plus_badge_pub]: https://img.shields.io/pub/v/package_info_plus.svg + +[sensor_plus]: https://pub.dev/packages/sensor_plus +[sensor_plus_code]: https://github.com/fluttercommunity/plus_plugins/tree/master/packages/sensor_plus +[sensor_plus_pub_points]: https://pub.dev/packages/sensor_plus/score +[sensor_plus_badge_pub_points]: https://badges.bar/sensor_plus/pub%20points +[sensor_plus_badge_pub]: https://img.shields.io/pub/v/sensor_plus.svg + +[share_plus]: https://pub.dev/packages/share_plus +[share_plus_code]: https://github.com/fluttercommunity/plus_plugins/tree/master/packages/share_plus +[share_plus_pub_points]: https://pub.dev/packages/share_plus/score +[share_plus_badge_pub_points]: https://badges.bar/share_plus/pub%20points +[share_plus_badge_pub]: https://img.shields.io/pub/v/share_plus.svg \ No newline at end of file diff --git a/analysis_options.yaml b/analysis_options.yaml new file mode 100644 index 0000000000..cb7a0a41d2 --- /dev/null +++ b/analysis_options.yaml @@ -0,0 +1,4 @@ +include: package:pedantic/analysis_options.1.8.0.yaml +linter: + rules: + - public_member_api_docs \ No newline at end of file diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000000..36d819834d --- /dev/null +++ b/docs/README.md @@ -0,0 +1,3 @@ +# Plus Plugins Docs + +work in progress \ No newline at end of file diff --git a/melos.yaml b/melos.yaml index ce5b102919..6d746c7ca4 100644 --- a/melos.yaml +++ b/melos.yaml @@ -16,13 +16,70 @@ scripts: analyze: > melos exec -c 1 --fail-fast -- \ pub global run tuneup check - # Formats the code of all packages (Java, Objective-C, and Dart). # - Requires `flutter_plugin_tools` (`pub global activate flutter_plugin_tools`). # - Requires `git`. # - Requires `clang-format` (can be installed via Brew on MacOS). format: pub global run flutter_plugin_tools format + # Build iOS plugin example apps. + build:examples:ios: > + melos exec -c 1 --scope="*example*" --fail-fast -- \ + flutter build ios --no-codesign + + # Build Android plugin example apps. + build:examples:android: > + melos exec -c 1 --scope="*example*" --fail-fast -- \ + flutter build apk + + # Build any plugin example apps that have MacOS support. + # - Requires `flutter config --enable-macos-desktop` enabled. + # - Requires `flutter channel master && flutter upgrade`. + build:examples:macos: > + melos exec -c 1 --scope="*example*" --dir-exists=macos --fail-fast -- \ + flutter build macos + + # Run standard flutter tests in all packages that have them. + test: > + melos exec -c 1 --fail-fast --dir-exists=test --ignore="*example*" --ignore="*web*" -- \ + flutter test + test:web: > + melos exec -c 1 --fail-fast --dir-exists=test --scope="*web*" -- \ + flutter test --platform=chrome + + # Run all test driver e2e tests in the example apps, use this for mobile. + # Will target Android/iOS depending on what emulator/simulator you have running. + test:e2e: > + melos exec -c 1 --fail-fast --scope="*example*" --dir-exists=test_driver -- \ + flutter drive --no-pub --target=./test_driver/MELOS_PARENT_PACKAGE_NAME_e2e.dart + + # Run all web test driver e2e tests in the example apps. + # - Requires `flutter channel master && flutter upgrade`. + # - Requires `flutter config --enable-web` enabled. + test:e2e:web: > + melos exec -c 1 --fail-fast --dir-exists=web --scope="*example*" --dir-exists=test_driver -- \ + flutter drive --release -d chrome --no-pub --verbose-system-logs --browser-name=chrome --target=./test_driver/MELOS_PARENT_PACKAGE_NAME_e2e.dart + + # Run all MacOS test driver e2e tests in the example apps. + # - Requires `flutter config --enable-macos-desktop` enabled. + # - Requires `flutter channel master && flutter upgrade`. + test:e2e:macos: > + melos exec -c 1 --fail-fast --dir-exists=macos --scope="*example*" --dir-exists=test_driver -- \ + flutter drive -d macos --no-pub --target=./test_driver/MELOS_PARENT_PACKAGE_NAME_e2e.dart + + # Check pubspecs are valid and publishable in each package. + lint:pub: > + melos exec -c 5 --fail-fast --no-private --ignore="*example*" -- \ + pub publish --dry-run + + # Additional cleanup lifecycle script, executed when `melos clean` is ran. + postclean: > + melos exec -- \ + rm -rf ./build ./android/.gradle ./ios/.symlinks ./ios/Pods ./android/.idea ./.idea ./.dart-tool/build + +dev_dependencies: + pedantic: 1.8.0 + environment: sdk: ">=2.1.0 <3.0.0" - flutter: ">=1.12.13+hotfix.5 <2.0.0" + flutter: ">=1.12.13+hotfix.5 <2.0.0" \ No newline at end of file diff --git a/website/README.md b/website/README.md new file mode 100644 index 0000000000..e8ce18492b --- /dev/null +++ b/website/README.md @@ -0,0 +1,5 @@ +# Plus Plugins website + +https://plus.fluttercommunity.dev/ + +work in progress! \ No newline at end of file