Skip to content

Commit 1cb684b

Browse files
committed
Merge branch 'master' of github.com:passsy/flutter_wrapper
2 parents 7701728 + 5d17acb commit 1cb684b

File tree

1 file changed

+66
-28
lines changed

1 file changed

+66
-28
lines changed

README.md

Lines changed: 66 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,113 @@
11
# Flutter Wrapper
22

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.
3+
`flutterw` is a tiny, open source shell script which downloads and executes the Flutter SDK with the exact version defined in your project respository.
4+
It encourages the idea that upgrading Flutter should happen per project, not per developer.
5+
Thus upgrading Flutter with `flutterw` automatically upgrades Flutter for your co-workers and on the CI servers.
46

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.
7+
The Flutter Wrapper will add the Flutter SDK as a git submodule to your project.
8+
It pins the version and the channel.
69

7-
Read the story on [Medium](https://medium.com/grandcentrix/flutter-wrapper-bind-your-project-to-an-explicit-flutter-release-4062cfe6dcaf)
10+
This project is inspired by the gradle wrapper.
811

9-
## How to use Flutter Wrapper
12+
Read more on [Medium](https://medium.com/grandcentrix/flutter-wrapper-bind-your-project-to-an-explicit-flutter-release-4062cfe6dcaf)
1013

11-
### Add the Flutter Wrapper to your project
1214

13-
Run this command from the root of your flutter project
15+
# Install flutterw
1416

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
17+
```bash
18+
sh -c "$(curl -fsSL https://raw.githubusercontent.com/passsy/flutter_wrapper/master/install.sh)"
19+
```
20+
_Open the Terminal, navigate to your project root and execute the line above._
21+
22+
From now on use `./flutterw` instead of `flutter`
23+
24+
![flutterw terminal demo](https://user-images.githubusercontent.com/1096485/64660427-840dc080-d440-11e9-97a2-a9e2bef203bd.gif)
25+
26+
## IDE Setup
27+
### Use with VScode
28+
29+
If you're a VScode user link the new Flutter SDK path in your settings
30+
`$projectRoot/.vscode/settings.json` (create if it doesn't exists yet)
31+
32+
```json
33+
{
34+
"dart.flutterSdkPath": ".flutter",
35+
}
36+
```
37+
38+
Commit this file to your git repo and your coworkers will automatically use `flutterw` from now on
39+
40+
### Use with IntelliJ / Android Studio
41+
42+
Go to `Preferences > Languages & Frameworks > Flutter` and set the Flutter SDK path to `$projectRoot/.flutter`
1843

19-
> `git commit -m "Add flutter wrapper"`
44+
<img width="800" alt="IntelliJ Settings" src="https://user-images.githubusercontent.com/1096485/64658026-3a1fdd00-d436-11e9-9457-556059f68e2c.png">
2045

21-
From now on you should always use `./flutterw` instead of `flutter`
46+
Add this step to the onboarding guidelines of your projects because this has to be done for every developer for every project using `flutterw`.
2247

23-
### Update Flutter
48+
49+
## Tips and Tricks
50+
### Upgrading Flutter
2451

2552
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.
53+
Run `./flutterw channel <stable|beta|dev|master>` to change the channel or update to the lastest version of a given channel.
2754

28-
> `./flutterw channel stable`
55+
```
56+
./flutterw channel beta
57+
./flutterw upgrade
58+
```
2959

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.
60+
Don't forget to commit the submodule changes.
3261

3362

34-
### Update flutter wrapper
63+
### Updating flutterw
3564

3665
To update the flutter wrapper to the latest version run the install command again:
3766

38-
> `sh -c "$(curl -fsSL https://raw.githubusercontent.com/passsy/flutter_wrapper/master/install.sh)"`
67+
```bash
68+
sh -c "$(curl -fsSL https://raw.githubusercontent.com/passsy/flutter_wrapper/master/install.sh)"
69+
```
3970

40-
To update the flutter wrapper to a specific verssion, use the `-t <tag/branch>` (i.e. `v0.8.0`)
71+
To update the flutter wrapper to a specific verssion, use the `-t <tag/branch>` (i.e. `v1.0.0`)
4172

42-
> `sh -c "curl -fsSL https://raw.githubusercontent.com/passsy/flutter_wrapper/master/install.sh" | bash /dev/stdin -t v1.0.0`
73+
```bash
74+
sh -c "curl -fsSL https://raw.githubusercontent.com/passsy/flutter_wrapper/master/install.sh" | bash /dev/stdin -t v1.0.0
75+
```
4376

44-
## Advanced Usage
4577

46-
### Uninstall flutter wrapper
78+
### Uninstall flutterw
4779

80+
Sorry to let you go!
4881
Removing submodules is hard, that's why I did the hard work for you.
4982
Simply run this command from the root of your flutter project and the uninstall script will cleanup everything.
5083

51-
> `sh -c "$(curl -fsSL https://raw.githubusercontent.com/passsy/flutter_wrapper/master/uninstall.sh)"`
84+
```bash
85+
sh -c "$(curl -fsSL https://raw.githubusercontent.com/passsy/flutter_wrapper/master/uninstall.sh)"
86+
```
5287

5388
Bye :wave:
5489

55-
### Get started with Flutter without adding flutter to your PATH
90+
### Create a new project using the flutter wrapper
5691

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.
92+
You can create a new Flutter project without installing Flutter globally on your machine.
6093

6194
```bash
95+
# 1. Create an empty git repo
6296
mkdir flutter_wrapper_project && cd "$_"
6397
git init
98+
99+
# 2. Install flutterw
64100
sh -c "$(curl -fsSL https://raw.githubusercontent.com/passsy/flutter_wrapper/master/install.sh)"
101+
102+
# 3. Create Flutter project
65103
./flutterw create .
66104
./flutterw run
67105
```
68106

69107
## License
70108

71109
```
72-
Copyright 2018 Pascal Welsch
110+
Copyright 2019 Pascal Welsch
73111
74112
Licensed under the Apache License, Version 2.0 (the "License");
75113
you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)