|
| 1 | +Contributing to Flutter |
| 2 | +======================= |
| 3 | + |
| 4 | +[](https://travis-ci.org/flutter/packages) |
| 5 | + |
| 6 | +_See also: [Flutter's code of conduct](https://flutter.io/design-principles/#code-of-conduct)_ |
| 7 | + |
| 8 | +Things you will need |
| 9 | +-------------------- |
| 10 | + |
| 11 | + * Linux, Mac OS X, or Windows. |
| 12 | + * git (used for source version control). |
| 13 | + * An ssh client (used to authenticate with GitHub). |
| 14 | + |
| 15 | +Getting the code and configuring your environment |
| 16 | +------------------------------------------------- |
| 17 | + |
| 18 | + * Ensure all the dependencies described in the previous section are installed. |
| 19 | + * Fork `https://github.com/flutter/packages` into your own GitHub account. If |
| 20 | + you already have a fork, and are now installing a development environment on |
| 21 | + a new machine, make sure you've updated your fork so that you don't use stale |
| 22 | + configuration options from long ago. |
| 23 | + * If you haven't configured your machine with an SSH key that's known to github, then |
| 24 | + follow [GitHub's directions](https://help.github.com/articles/generating-ssh-keys/) |
| 25 | + to generate an SSH key. |
| 26 | + * `git clone [email protected]:<your_name_here>/packages.git` |
| 27 | + * `cd packages` |
| 28 | + * `git remote add upstream [email protected]:flutter/packages.git` (So that you |
| 29 | + fetch from the master repository, not your clone, when running `git fetch` |
| 30 | + et al.) |
| 31 | + |
| 32 | +Running the examples |
| 33 | +-------------------- |
| 34 | + |
| 35 | +To run an example with a prebuilt binary from the cloud, switch to that |
| 36 | +example's directory, run `flutter packages get` to make sure its dependencies have been |
| 37 | +downloaded, and use `flutter run`. Make sure you have a device connected over |
| 38 | +USB and debugging enabled on that device. For example: |
| 39 | + |
| 40 | + * `cd packages/palette_generator/example/image_colors` |
| 41 | + * `flutter packages get` |
| 42 | + * `flutter run` |
| 43 | + |
| 44 | +Contributing code |
| 45 | +----------------- |
| 46 | + |
| 47 | +We gladly accept contributions via GitHub pull requests. |
| 48 | + |
| 49 | +Please peruse our |
| 50 | +[style guide](https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo) and |
| 51 | +[design principles](https://flutter.io/design-principles/) before |
| 52 | +working on anything non-trivial. These guidelines are intended to |
| 53 | +keep the code consistent and avoid common pitfalls. |
| 54 | + |
| 55 | +To start working on a patch: |
| 56 | + |
| 57 | + * `git fetch upstream` |
| 58 | + * `git checkout upstream/master -b <name_of_your_branch>` |
| 59 | + * Hack away. |
| 60 | + * Verify changes with [flutter_plugin_tools](https://pub.dartlang.org/packages/flutter_plugin_tools) |
| 61 | +``` |
| 62 | +pub global activate flutter_plugin_tools |
| 63 | +pub global run flutter_plugin_tools format --plugins package_name |
| 64 | +pub global run flutter_plugin_tools analyze --plugins package_name |
| 65 | +pub global run flutter_plugin_tools test --plugins package_name |
| 66 | +``` |
| 67 | + * `git commit -a -m "<your informative commit message>"` |
| 68 | + * `git push origin <name_of_your_branch>` |
| 69 | + |
| 70 | +To send us a pull request: |
| 71 | + |
| 72 | +* `git pull-request` (if you are using [Hub](http://github.com/github/hub/)) or |
| 73 | + go to `https://github.com/flutter/packages` and click the |
| 74 | + "Compare & pull request" button |
| 75 | + |
| 76 | +Please make sure all your checkins have detailed commit messages explaining the patch. |
| 77 | + |
| 78 | +Once you've gotten an LGTM from a project maintainer and once your PR has received |
| 79 | +the green light from all our automated testing (Travis, AppVeyor, etc), submit your |
| 80 | +changes to the `master` branch using one of the following methods: |
| 81 | + |
| 82 | +* Wait for one of the project maintainers to submit it for you. |
| 83 | +* Click the green "Merge pull request" button on the GitHub UI of your pull |
| 84 | + request (requires commit access). |
| 85 | + |
| 86 | +You must complete the [Contributor License Agreement](https://cla.developers.google.com/clas). |
| 87 | +You can do this online, and it only takes a minute. |
| 88 | +If you've never submitted code before, you must add your (or your |
| 89 | +organization's) name and contact info to the [AUTHORS](AUTHORS) file. |
| 90 | + |
| 91 | +We grant commit access to people who have gained our trust and demonstrated |
| 92 | +a commitment to Flutter. |
0 commit comments