|
1 | 1 | # Flutter Wrapper
|
2 | 2 |
|
3 |
| -Similar to the gradle wrapper, an executable shell script in the root of you project, `flutterw` which downloads and runs flutter in the correct version for every user. |
| 3 | +Similar to the gradle wrapper, an executable shell script in the root of you project, `flutterw` which downloads and runs flutter with the same version, part of your repository, for every user and CI. |
4 | 4 |
|
5 | 5 | The flutter wrapper will add flutter as a submodule to your project which pins the version allowing you to upgrade flutter for all developers in you project at the same time.
|
6 | 6 |
|
7 | 7 | Read the story on [Medium](https://medium.com/grandcentrix/flutter-wrapper-bind-your-project-to-an-explicit-flutter-release-4062cfe6dcaf)
|
8 | 8 |
|
9 |
| -## Get started |
| 9 | +## How to use Flutter Wrapper |
10 | 10 |
|
11 |
| -#### Install wrapper |
| 11 | +### Add the Flutter Wrapper to your project |
12 | 12 |
|
13 | 13 | Run this command from the root of your flutter project
|
14 | 14 |
|
15 |
| -```bash |
16 |
| -curl -sL https://raw.githubusercontent.com/passsy/flutter_wrapper/master/install.sh | bash - |
17 |
| -``` |
18 |
| -Don't forget to commit your changes afterwards. |
| 15 | +> `sh -c "$(curl -fsSL https://raw.githubusercontent.com/passsy/flutter_wrapper/master/install.sh)"` |
| 16 | +> |
| 17 | +All required files are already added to git. You can commit them now |
19 | 18 |
|
| 19 | +> `git commit -m "Add flutter wrapper"` |
20 | 20 |
|
21 |
| -#### Get started with Flutter without adding flutter to your PATH |
| 21 | +From now on you should always use `./flutterw` instead of `flutter` |
22 | 22 |
|
23 |
| -The [Flutter install process](https://flutter.io/setup-macos/#get-sdk) is not perfectly automated. You have to manually download Flutter and add it to your path before you can use the awesome Flutter CLI to create a new project. With the flutter wrapper this becomes easier. |
| 23 | +### Update Flutter |
24 | 24 |
|
25 |
| -```bash |
26 |
| -mkdir flutter_wrapper_project && cd "$_" |
27 |
| -git init |
28 |
| -curl -sL https://raw.githubusercontent.com/passsy/flutter_wrapper/master/install.sh | bash - |
29 |
| -./flutterw create . |
30 |
| -./flutterw run |
31 |
| -``` |
| 25 | +Flutter Wrapper doesn't require any special command to update Flutter. |
| 26 | +Run `./flutterw channel <stable|beta|master>` to change the channel or update to the lastest version of a given channel. |
32 | 27 |
|
33 |
| -## Maintenance |
| 28 | +> `./flutterw channel stable` |
34 | 29 |
|
35 |
| -#### Update flutter wrapper |
| 30 | +The only change you'll see in git is the changed sha1 of the `.flutter` submodule. |
| 31 | +You have to commit it to update flutter for all project members. |
36 | 32 |
|
37 |
| -Run the install command again. |
38 | 33 |
|
39 |
| -```bash |
40 |
| -curl -sL https://raw.githubusercontent.com/passsy/flutter_wrapper/master/install.sh | bash - |
41 |
| -``` |
| 34 | +### Update flutter wrapper |
42 | 35 |
|
43 |
| -If you want a specific version, use the `-t <tag/branch>` (i.e. `v0.8.0`) |
| 36 | +To update the flutter wrapper to the latest version run the install command again: |
44 | 37 |
|
45 |
| -```bash |
46 |
| -curl -sL https://raw.githubusercontent.com/passsy/flutter_wrapper/master/install.sh | bash /dev/stdin -t v0.8.0 |
47 |
| -``` |
| 38 | +> `sh -c "$(curl -fsSL https://raw.githubusercontent.com/passsy/flutter_wrapper/master/install.sh)"` |
| 39 | +
|
| 40 | +To update the flutter wrapper to a specific verssion, use the `-t <tag/branch>` (i.e. `v0.8.0`) |
48 | 41 |
|
49 |
| -#### Uninstall flutter wrapper |
| 42 | +> `sh -c "curl -fsSL https://raw.githubusercontent.com/passsy/flutter_wrapper/master/install.sh" | bash /dev/stdin -t v1.0.0` |
| 43 | +
|
| 44 | +## Advanced Usage |
| 45 | + |
| 46 | +### Uninstall flutter wrapper |
50 | 47 |
|
51 | 48 | Removing submodules is hard, that's why I did the hard work for you.
|
52 | 49 | Simply run this command from the root of your flutter project and the uninstall script will cleanup everything.
|
53 | 50 |
|
54 |
| -Bye :wave: |
| 51 | +> `sh -c "$(curl -fsSL https://raw.githubusercontent.com/passsy/flutter_wrapper/master/uninstall.sh)"` |
55 | 52 |
|
56 |
| -```bash |
57 |
| -curl -sL https://raw.githubusercontent.com/passsy/flutter_wrapper/master/uninstall.sh | bash - |
58 |
| -``` |
| 53 | +Bye :wave: |
59 | 54 |
|
60 |
| -#### Update flutter version |
| 55 | +### Get started with Flutter without adding flutter to your PATH |
61 | 56 |
|
62 |
| -No special command required. Run `./flutterw channel <master|dev|beta>`, afterwards add and commit changed `.flutter` submodule reference. |
| 57 | +The [Flutter install process](https://flutter.io/setup-macos/#get-sdk) is not perfectly automated. |
| 58 | +You have to manually download Flutter and add it to your path before you can use the awesome Flutter CLI to create a new project. |
| 59 | +With the Flutter Wrapper this becomes easier. |
63 | 60 |
|
| 61 | +```bash |
| 62 | +mkdir flutter_wrapper_project && cd "$_" |
| 63 | +git init |
| 64 | +sh -c "$(curl -fsSL https://raw.githubusercontent.com/passsy/flutter_wrapper/master/install.sh)" |
| 65 | +./flutterw create . |
| 66 | +./flutterw run |
| 67 | +``` |
64 | 68 |
|
65 | 69 | ## License
|
66 | 70 |
|
|
0 commit comments